Last change
on this file since 6a80231 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
646 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | "use strict";
|
---|
| 2 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 3 | var Observable_1 = require("../Observable");
|
---|
| 4 | var from_1 = require("./from");
|
---|
| 5 | var empty_1 = require("./empty");
|
---|
| 6 | function defer(observableFactory) {
|
---|
| 7 | return new Observable_1.Observable(function (subscriber) {
|
---|
| 8 | var input;
|
---|
| 9 | try {
|
---|
| 10 | input = observableFactory();
|
---|
| 11 | }
|
---|
| 12 | catch (err) {
|
---|
| 13 | subscriber.error(err);
|
---|
| 14 | return undefined;
|
---|
| 15 | }
|
---|
| 16 | var source = input ? from_1.from(input) : empty_1.empty();
|
---|
| 17 | return source.subscribe(subscriber);
|
---|
| 18 | });
|
---|
| 19 | }
|
---|
| 20 | exports.defer = defer;
|
---|
| 21 | //# sourceMappingURL=defer.js.map |
---|
Note:
See
TracBrowser
for help on using the repository browser.