UNPKG

1.35 kBTypeScriptView Raw
1import { 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 */
37export declare function ignoreElements(): OperatorFunction<unknown, never>;
38//# sourceMappingURL=ignoreElements.d.ts.map
\No newline at end of file