source: trip-planner-front/node_modules/rxjs/_esm5/internal/observable/defer.js@ bdd6491

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

initial commit

  • Property mode set to 100644
File size: 591 bytes
Line 
1/** PURE_IMPORTS_START _Observable,_from,_empty PURE_IMPORTS_END */
2import { Observable } from '../Observable';
3import { from } from './from';
4import { empty } from './empty';
5export function defer(observableFactory) {
6 return new Observable(function (subscriber) {
7 var input;
8 try {
9 input = observableFactory();
10 }
11 catch (err) {
12 subscriber.error(err);
13 return undefined;
14 }
15 var source = input ? from(input) : empty();
16 return source.subscribe(subscriber);
17 });
18}
19//# sourceMappingURL=defer.js.map
Note: See TracBrowser for help on using the repository browser.