a zip code crypto-currency system good for red ONLY

takeUntil.js 1.4KB

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