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.

empty.d.ts 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { Observable } from '../Observable';
  2. import { SchedulerLike } from '../types';
  3. /**
  4. * The same Observable instance returned by any call to {@link empty} without a
  5. * `scheduler`. It is preferrable to use this over `empty()`.
  6. */
  7. export declare const EMPTY: Observable<never>;
  8. /**
  9. * Creates an Observable that emits no items to the Observer and immediately
  10. * emits a complete notification.
  11. *
  12. * <span class="informal">Just emits 'complete', and nothing else.
  13. * </span>
  14. *
  15. * ![](empty.png)
  16. *
  17. * This static operator is useful for creating a simple Observable that only
  18. * emits the complete notification. It can be used for composing with other
  19. * Observables, such as in a {@link mergeMap}.
  20. *
  21. * ## Examples
  22. * ### Emit the number 7, then complete
  23. * ```javascript
  24. * const result = empty().pipe(startWith(7));
  25. * result.subscribe(x => console.log(x));
  26. * ```
  27. *
  28. * ### Map and flatten only odd numbers to the sequence 'a', 'b', 'c'
  29. * ```javascript
  30. * const interval$ = interval(1000);
  31. * result = interval$.pipe(
  32. * mergeMap(x => x % 2 === 1 ? of('a', 'b', 'c') : empty()),
  33. * );
  34. * result.subscribe(x => console.log(x));
  35. *
  36. * // Results in the following to the console:
  37. * // x is equal to the count on the interval eg(0,1,2,3,...)
  38. * // x will occur every 1000ms
  39. * // if x % 2 is equal to 1 print abc
  40. * // if x % 2 is not equal to 1 nothing will be output
  41. * ```
  42. *
  43. * @see {@link Observable}
  44. * @see {@link never}
  45. * @see {@link of}
  46. * @see {@link throwError}
  47. *
  48. * @param {SchedulerLike} [scheduler] A {@link SchedulerLike} to use for scheduling
  49. * the emission of the complete notification.
  50. * @return {Observable} An "empty" Observable: emits only the complete
  51. * notification.
  52. * @static true
  53. * @name empty
  54. * @owner Observable
  55. * @deprecated Deprecated in favor of using {@link index/EMPTY} constant.
  56. */
  57. export declare function empty(scheduler?: SchedulerLike): Observable<never>;
  58. export declare function emptyScheduled(scheduler: SchedulerLike): Observable<never>;