Subtheme of barrio
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
2.0 KiB

{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../src/operators/publish.ts"],"names":[],"mappings":";AACA,wBAAwB,YAAY,CAAC,CAAA;AACrC,0BAA0B,aAAa,CAAC,CAAA;AAQxC,mCAAmC;AAEnC;;;;;;;;;;;;GAYG;AACH,iBAA8B,QAAiC;IAC7D,MAAM,CAAC,QAAQ;QACb,qBAAS,CAAC,cAAM,OAAA,IAAI,iBAAO,EAAK,EAAhB,CAAgB,EAAE,QAAQ,CAAC;QAC3C,qBAAS,CAAC,IAAI,iBAAO,EAAK,CAAC,CAAC;AAChC,CAAC;AAJe,eAAO,UAItB,CAAA","sourcesContent":["import { Observable } from '../Observable';\nimport { Subject } from '../Subject';\nimport { multicast } from './multicast';\nimport { ConnectableObservable } from '../observable/ConnectableObservable';\nimport { MonoTypeOperatorFunction, OperatorFunction, UnaryFunction } from '../interfaces';\n\n/* tslint:disable:max-line-length */\nexport function publish<T>(): UnaryFunction<Observable<T>, ConnectableObservable<T>>;\nexport function publish<T>(selector: MonoTypeOperatorFunction<T>): MonoTypeOperatorFunction<T>;\nexport function publish<T, R>(selector: OperatorFunction<T, R>): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns a ConnectableObservable, which is a variety of Observable that waits until its connect method is called\n * before it begins emitting items to those Observers that have subscribed to it.\n *\n * <img src=\"./img/publish.png\" width=\"100%\">\n *\n * @param {Function} [selector] - Optional selector function which can use the multicasted source sequence as many times\n * as needed, without causing multiple subscriptions to the source sequence.\n * Subscribers to the given source will receive all notifications of the source from the time of the subscription on.\n * @return A ConnectableObservable that upon connection causes the source Observable to emit items to its Observers.\n * @method publish\n * @owner Observable\n */\nexport function publish<T, R>(selector?: OperatorFunction<T, R>): MonoTypeOperatorFunction<T> | OperatorFunction<T, R> {\n return selector ?\n multicast(() => new Subject<T>(), selector) :\n multicast(new Subject<T>());\n}\n"]}