source: trip-planner-front/node_modules/rxjs/_esm5/internal/util/subscribeTo.js@ 8d391a1

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

initial commit

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/** PURE_IMPORTS_START _subscribeToArray,_subscribeToPromise,_subscribeToIterable,_subscribeToObservable,_isArrayLike,_isPromise,_isObject,_symbol_iterator,_symbol_observable PURE_IMPORTS_END */
2import { subscribeToArray } from './subscribeToArray';
3import { subscribeToPromise } from './subscribeToPromise';
4import { subscribeToIterable } from './subscribeToIterable';
5import { subscribeToObservable } from './subscribeToObservable';
6import { isArrayLike } from './isArrayLike';
7import { isPromise } from './isPromise';
8import { isObject } from './isObject';
9import { iterator as Symbol_iterator } from '../symbol/iterator';
10import { observable as Symbol_observable } from '../symbol/observable';
11export var subscribeTo = function (result) {
12 if (!!result && typeof result[Symbol_observable] === 'function') {
13 return subscribeToObservable(result);
14 }
15 else if (isArrayLike(result)) {
16 return subscribeToArray(result);
17 }
18 else if (isPromise(result)) {
19 return subscribeToPromise(result);
20 }
21 else if (!!result && typeof result[Symbol_iterator] === 'function') {
22 return subscribeToIterable(result);
23 }
24 else {
25 var value = isObject(result) ? 'an invalid object' : "'" + result + "'";
26 var msg = "You provided " + value + " where a stream was expected."
27 + ' You can provide an Observable, Promise, Array, or Iterable.';
28 throw new TypeError(msg);
29 }
30};
31//# sourceMappingURL=subscribeTo.js.map
Note: See TracBrowser for help on using the repository browser.