This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/rxjs/_esm2015/internal/observable/merge.js

23 lines
901 B
JavaScript
Raw Permalink Normal View History

2019-08-11 18:48:02 +00:00
import { Observable } from '../Observable';
import { isScheduler } from '../util/isScheduler';
import { mergeAll } from '../operators/mergeAll';
import { fromArray } from './fromArray';
export function merge(...observables) {
let concurrent = Number.POSITIVE_INFINITY;
let scheduler = null;
let last = observables[observables.length - 1];
if (isScheduler(last)) {
scheduler = observables.pop();
if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {
concurrent = observables.pop();
}
}
else if (typeof last === 'number') {
concurrent = observables.pop();
}
if (scheduler === null && observables.length === 1 && observables[0] instanceof Observable) {
return observables[0];
}
return mergeAll(concurrent)(fromArray(observables, scheduler));
}
//# sourceMappingURL=merge.js.map