c3fe3e70cc6e697eef9896f3d9d7df09fb18a5c7429a60e8bb8e0737357e86f253e6eccce13bd467d48c86695708c02084474d8d31423d6508d4ca3aba16ea 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { OperatorFunction } from '../types';
  2. /**
  3. * Ignores all items emitted by the source Observable and only passes calls of `complete` or `error`.
  4. *
  5. * ![](ignoreElements.png)
  6. *
  7. * The `ignoreElements` operator suppresses all items emitted by the source Observable,
  8. * but allows its termination notification (either `error` or `complete`) to pass through unchanged.
  9. *
  10. * If you do not care about the items being emitted by an Observable, but you do want to be notified
  11. * when it completes or when it terminates with an error, you can apply the `ignoreElements` operator
  12. * to the Observable, which will ensure that it will never call its observers’ `next` handlers.
  13. *
  14. * ## Example
  15. *
  16. * Ignore all `next` emissions from the source
  17. *
  18. * ```ts
  19. * import { of, ignoreElements } from 'rxjs';
  20. *
  21. * of('you', 'talking', 'to', 'me')
  22. * .pipe(ignoreElements())
  23. * .subscribe({
  24. * next: word => console.log(word),
  25. * error: err => console.log('error:', err),
  26. * complete: () => console.log('the end'),
  27. * });
  28. *
  29. * // result:
  30. * // 'the end'
  31. * ```
  32. *
  33. * @return A function that returns an empty Observable that only calls
  34. * `complete` or `error`, based on which one is called by the source
  35. * Observable.
  36. */
  37. export declare function ignoreElements(): OperatorFunction<unknown, never>;
  38. //# sourceMappingURL=ignoreElements.d.ts.map