source: trip-planner-front/node_modules/rxjs/_esm2015/internal/observable/merge.js@ eed0bf8

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

initial commit

  • Property mode set to 100644
File size: 901 bytes
Line 
1import { Observable } from '../Observable';
2import { isScheduler } from '../util/isScheduler';
3import { mergeAll } from '../operators/mergeAll';
4import { fromArray } from './fromArray';
5export function merge(...observables) {
6 let concurrent = Number.POSITIVE_INFINITY;
7 let scheduler = null;
8 let last = observables[observables.length - 1];
9 if (isScheduler(last)) {
10 scheduler = observables.pop();
11 if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {
12 concurrent = observables.pop();
13 }
14 }
15 else if (typeof last === 'number') {
16 concurrent = observables.pop();
17 }
18 if (scheduler === null && observables.length === 1 && observables[0] instanceof Observable) {
19 return observables[0];
20 }
21 return mergeAll(concurrent)(fromArray(observables, scheduler));
22}
23//# sourceMappingURL=merge.js.map
Note: See TracBrowser for help on using the repository browser.