Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / _esm2015 / internal / observable / defer.js
1 import { Observable } from '../Observable';
2 import { from } from './from';
3 import { empty } from './empty';
4 export function defer(observableFactory) {
5     return new Observable(subscriber => {
6         let input;
7         try {
8             input = observableFactory();
9         }
10         catch (err) {
11             subscriber.error(err);
12             return undefined;
13         }
14         const source = input ? from(input) : empty();
15         return source.subscribe(subscriber);
16     });
17 }
18 //# sourceMappingURL=defer.js.map