Front end of the Slack clone application.

takeUntil.js 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. "use strict";
  2. var takeUntil_1 = require('../operators/takeUntil');
  3. /**
  4. * Emits the values emitted by the source Observable until a `notifier`
  5. * Observable emits a value.
  6. *
  7. * <span class="informal">Lets values pass until a second Observable,
  8. * `notifier`, emits something. Then, it completes.</span>
  9. *
  10. * <img src="./img/takeUntil.png" width="100%">
  11. *
  12. * `takeUntil` subscribes and begins mirroring the source Observable. It also
  13. * monitors a second Observable, `notifier` that you provide. If the `notifier`
  14. * emits a value, the output Observable stops mirroring the source Observable
  15. * and completes.
  16. *
  17. * @example <caption>Tick every second until the first click happens</caption>
  18. * var interval = Rx.Observable.interval(1000);
  19. * var clicks = Rx.Observable.fromEvent(document, 'click');
  20. * var result = interval.takeUntil(clicks);
  21. * result.subscribe(x => console.log(x));
  22. *
  23. * @see {@link take}
  24. * @see {@link takeLast}
  25. * @see {@link takeWhile}
  26. * @see {@link skip}
  27. *
  28. * @param {Observable} notifier The Observable whose first emitted value will
  29. * cause the output Observable of `takeUntil` to stop emitting values from the
  30. * source Observable.
  31. * @return {Observable<T>} An Observable that emits the values from the source
  32. * Observable until such time as `notifier` emits its first value.
  33. * @method takeUntil
  34. * @owner Observable
  35. */
  36. function takeUntil(notifier) {
  37. return takeUntil_1.takeUntil(notifier)(this);
  38. }
  39. exports.takeUntil = takeUntil;
  40. //# sourceMappingURL=takeUntil.js.map