1d851107f310081c8b04ba25694e9bb67a577205fedef86e228088e81e63284f69c024057ec9ea5e3cee2136489bdd825605f1f062dfb5ff70c0084349079f 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { Observable } from '../Observable';
  2. /**
  3. * An Observable that emits no items to the Observer and never completes.
  4. *
  5. * ![](never.png)
  6. *
  7. * A simple Observable that emits neither values nor errors nor the completion
  8. * notification. It can be used for testing purposes or for composing with other
  9. * Observables. Please note that by never emitting a complete notification, this
  10. * Observable keeps the subscription from being disposed automatically.
  11. * Subscriptions need to be manually disposed.
  12. *
  13. * ## Example
  14. *
  15. * Emit the number 7, then never emit anything else (not even complete)
  16. *
  17. * ```ts
  18. * import { NEVER, startWith } from 'rxjs';
  19. *
  20. * const info = () => console.log('Will not be called');
  21. *
  22. * const result = NEVER.pipe(startWith(7));
  23. * result.subscribe({
  24. * next: x => console.log(x),
  25. * error: info,
  26. * complete: info
  27. * });
  28. * ```
  29. *
  30. * @see {@link Observable}
  31. * @see {@link EMPTY}
  32. * @see {@link of}
  33. * @see {@link throwError}
  34. */
  35. export declare const NEVER: Observable<never>;
  36. /**
  37. * @deprecated Replaced with the {@link NEVER} constant. Will be removed in v8.
  38. */
  39. export declare function never(): Observable<never>;
  40. //# sourceMappingURL=never.d.ts.map