Front end of the Slack clone application.

share.js 1.1KB

123456789101112131415161718192021222324
  1. "use strict";
  2. var share_1 = require('../operators/share');
  3. /**
  4. * Returns a new Observable that multicasts (shares) the original Observable. As long as there is at least one
  5. * Subscriber this Observable will be subscribed and emitting data. When all subscribers have unsubscribed it will
  6. * unsubscribe from the source Observable. Because the Observable is multicasting it makes the stream `hot`.
  7. *
  8. * This behaves similarly to .publish().refCount(), with a behavior difference when the source observable emits complete.
  9. * .publish().refCount() will not resubscribe to the original source, however .share() will resubscribe to the original source.
  10. * Observable.of("test").publish().refCount() will not re-emit "test" on new subscriptions, Observable.of("test").share() will
  11. * re-emit "test" to new subscriptions.
  12. *
  13. * <img src="./img/share.png" width="100%">
  14. *
  15. * @return {Observable<T>} An Observable that upon connection causes the source Observable to emit items to its Observers.
  16. * @method share
  17. * @owner Observable
  18. */
  19. function share() {
  20. return share_1.share()(this);
  21. }
  22. exports.share = share;
  23. ;
  24. //# sourceMappingURL=share.js.map