source: trip-planner-front/node_modules/rxjs/_esm2015/internal/observable/defer.js@ eed0bf8

Last change on this file since eed0bf8 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 516 bytes
Line 
1import { Observable } from '../Observable';
2import { from } from './from';
3import { empty } from './empty';
4export 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
Note: See TracBrowser for help on using the repository browser.