1 import { Observable } from '../Observable';
2 import { noop } from '../util/noop';
5 * An Observable that emits no items to the Observer and never completes.
9 * A simple Observable that emits neither values nor errors nor the completion
10 * notification. It can be used for testing purposes or for composing with other
11 * Observables. Please note that by never emitting a complete notification, this
12 * Observable keeps the subscription from being disposed automatically.
13 * Subscriptions need to be manually disposed.
16 * ### Emit the number 7, then never emit anything else (not even complete)
18 * import { NEVER } from 'rxjs';
19 * import { startWith } from 'rxjs/operators';
22 * console.log('Will not be called');
24 * const result = NEVER.pipe(startWith(7));
25 * result.subscribe(x => console.log(x), info, info);
29 * @see {@link Observable}
30 * @see {@link index/EMPTY}
32 * @see {@link throwError}
34 export const NEVER = new Observable<never>(noop);
37 * @deprecated Deprecated in favor of using {@link NEVER} constant.
39 export function never () {