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
1.5 KiB

{"version":3,"file":"share.js","sourceRoot":"","sources":["../../src/operators/share.ts"],"names":[],"mappings":";AACA,0BAA0B,aAAa,CAAC,CAAA;AACxC,yBAAyB,YAAY,CAAC,CAAA;AACtC,wBAAwB,YAAY,CAAC,CAAA;AAIrC;IACE,MAAM,CAAC,IAAI,iBAAO,EAAE,CAAC;AACvB,CAAC;AAED;;;;;;;;;;;GAWG;AACH;IACE,MAAM,CAAC,UAAC,MAAqB,IAAK,OAAA,mBAAQ,EAAE,CAAC,qBAAS,CAAC,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAkB,EAAnE,CAAmE,CAAC;AACxG,CAAC;AAFe,aAAK,QAEpB,CAAA;AAAA,CAAC","sourcesContent":["import { Observable } from '../Observable';\nimport { multicast } from './multicast';\nimport { refCount } from './refCount';\nimport { Subject } from '../Subject';\n\nimport { MonoTypeOperatorFunction } from '../interfaces';\n\nfunction shareSubjectFactory() {\n return new Subject();\n}\n\n/**\n * Returns a new Observable that multicasts (shares) the original Observable. As long as there is at least one\n * Subscriber this Observable will be subscribed and emitting data. When all subscribers have unsubscribed it will\n * unsubscribe from the source Observable. Because the Observable is multicasting it makes the stream `hot`.\n * This is an alias for .multicast(() => new Subject()).refCount().\n *\n * <img src=\"./img/share.png\" width=\"100%\">\n *\n * @return {Observable<T>} An Observable that upon connection causes the source Observable to emit items to its Observers.\n * @method share\n * @owner Observable\n */\nexport function share<T>(): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => refCount()(multicast(shareSubjectFactory)(source)) as Observable<T>;\n};\n"]}