UNPKG

1.33 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 of the 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 * ## Examples
15 * ```ts
16 * import { of } from 'rxjs';
17 * import { ignoreElements } from 'rxjs/operators';
18 *
19 * of('you', 'talking', 'to', 'me').pipe(
20 * ignoreElements(),
21 * )
22 * .subscribe({
23 * next: word => console.log(word),
24 * error: err => console.log('error:', err),
25 * complete: () => console.log('the end'),
26 * });
27 * // result:
28 * // 'the end'
29 * ```
30 * @return A function that returns an empty Observable that only calls
31 * `complete` or `error`, based on which one is called by the source
32 * Observable.
33 */
34export declare function ignoreElements(): OperatorFunction<any, never>;
35//# sourceMappingURL=ignoreElements.d.ts.map
\No newline at end of file