Last change
on this file 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 */
|
---|
2 | import { Observable } from '../Observable';
|
---|
3 | import { from } from './from';
|
---|
4 | import { empty } from './empty';
|
---|
5 | export 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.