source: trip-planner-front/node_modules/rxjs/internal/util/subscribeTo.js@ fa375fe

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

initial commit

  • Property mode set to 100644
File size: 1.4 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var subscribeToArray_1 = require("./subscribeToArray");
4var subscribeToPromise_1 = require("./subscribeToPromise");
5var subscribeToIterable_1 = require("./subscribeToIterable");
6var subscribeToObservable_1 = require("./subscribeToObservable");
7var isArrayLike_1 = require("./isArrayLike");
8var isPromise_1 = require("./isPromise");
9var isObject_1 = require("./isObject");
10var iterator_1 = require("../symbol/iterator");
11var observable_1 = require("../symbol/observable");
12exports.subscribeTo = function (result) {
13 if (!!result && typeof result[observable_1.observable] === 'function') {
14 return subscribeToObservable_1.subscribeToObservable(result);
15 }
16 else if (isArrayLike_1.isArrayLike(result)) {
17 return subscribeToArray_1.subscribeToArray(result);
18 }
19 else if (isPromise_1.isPromise(result)) {
20 return subscribeToPromise_1.subscribeToPromise(result);
21 }
22 else if (!!result && typeof result[iterator_1.iterator] === 'function') {
23 return subscribeToIterable_1.subscribeToIterable(result);
24 }
25 else {
26 var value = isObject_1.isObject(result) ? 'an invalid object' : "'" + result + "'";
27 var msg = "You provided " + value + " where a stream was expected."
28 + ' You can provide an Observable, Promise, Array, or Iterable.';
29 throw new TypeError(msg);
30 }
31};
32//# sourceMappingURL=subscribeTo.js.map
Note: See TracBrowser for help on using the repository browser.