publish.js 1.0 KB

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var operators_1 = require("rxjs/operators");
  4. /* tslint:enable:max-line-length */
  5. /**
  6. * Returns a ConnectableObservable, which is a variety of Observable that waits until its connect method is called
  7. * before it begins emitting items to those Observers that have subscribed to it.
  8. *
  9. * <img src="./img/publish.png" width="100%">
  10. *
  11. * @param {Function} [selector] - Optional selector function which can use the multicasted source sequence as many times
  12. * as needed, without causing multiple subscriptions to the source sequence.
  13. * Subscribers to the given source will receive all notifications of the source from the time of the subscription on.
  14. * @return A ConnectableObservable that upon connection causes the source Observable to emit items to its Observers.
  15. * @method publish
  16. * @owner Observable
  17. */
  18. function publish(selector) {
  19. return operators_1.publish(selector)(this);
  20. }
  21. exports.publish = publish;
  22. //# sourceMappingURL=publish.js.map