Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

takeUntil.d.ts 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { Observable } from '../Observable';
  2. import { MonoTypeOperatorFunction } from '../types';
  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 a value. Then, it completes.</span>
  9. *
  10. * ![](takeUntil.png)
  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. If the `notifier` doesn't emit any value and completes
  16. * then `takeUntil` will pass all values.
  17. *
  18. * ## Example
  19. * Tick every second until the first click happens
  20. * ```javascript
  21. * const interval = interval(1000);
  22. * const clicks = fromEvent(document, 'click');
  23. * const result = interval.pipe(takeUntil(clicks));
  24. * result.subscribe(x => console.log(x));
  25. * ```
  26. *
  27. * @see {@link take}
  28. * @see {@link takeLast}
  29. * @see {@link takeWhile}
  30. * @see {@link skip}
  31. *
  32. * @param {Observable} notifier The Observable whose first emitted value will
  33. * cause the output Observable of `takeUntil` to stop emitting values from the
  34. * source Observable.
  35. * @return {Observable<T>} An Observable that emits the values from the source
  36. * Observable until such time as `notifier` emits its first value.
  37. * @method takeUntil
  38. * @owner Observable
  39. */
  40. export declare function takeUntil<T>(notifier: Observable<any>): MonoTypeOperatorFunction<T>;