Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
901 bytes
|
Line | |
---|
1 | import { Observable } from '../Observable';
|
---|
2 | import { isScheduler } from '../util/isScheduler';
|
---|
3 | import { mergeAll } from '../operators/mergeAll';
|
---|
4 | import { fromArray } from './fromArray';
|
---|
5 | export 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.