1 import { MonoTypeOperatorFunction } from '../types';
3 * If the source observable completes without emitting a value, it will emit
4 * an error. The error will be created at that time by the optional
5 * `errorFactory` argument, otherwise, the error will be {@link EmptyError}.
7 * ![](throwIfEmpty.png)
11 * import { fromEvent, timer } from 'rxjs';
12 * import { throwIfEmpty, takeUntil } from 'rxjs/operators';
14 * const click$ = fromEvent(document, 'click');
17 * takeUntil(timer(1000)),
19 * () => new Error('the document was not clicked within 1 second')
23 * next() { console.log('The button was clicked'); },
24 * error(err) { console.error(err); }
28 * @param errorFactory A factory function called to produce the
29 * error to be thrown when the source observable completes without emitting a
32 export declare function throwIfEmpty<T>(errorFactory?: (() => any)): MonoTypeOperatorFunction<T>;