Front end of the Slack clone application.

takeUntil.d.ts 1.4KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { Observable } from '../Observable';
  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 declare function takeUntil<T>(this: Observable<T>, notifier: Observable<any>): Observable<T>;