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.1 KB
|
Line | |
---|
1 | /** PURE_IMPORTS_START _Observable,_util_isScheduler,_operators_mergeAll,_fromArray PURE_IMPORTS_END */
|
---|
2 | import { Observable } from '../Observable';
|
---|
3 | import { isScheduler } from '../util/isScheduler';
|
---|
4 | import { mergeAll } from '../operators/mergeAll';
|
---|
5 | import { fromArray } from './fromArray';
|
---|
6 | export function merge() {
|
---|
7 | var observables = [];
|
---|
8 | for (var _i = 0; _i < arguments.length; _i++) {
|
---|
9 | observables[_i] = arguments[_i];
|
---|
10 | }
|
---|
11 | var concurrent = Number.POSITIVE_INFINITY;
|
---|
12 | var scheduler = null;
|
---|
13 | var last = observables[observables.length - 1];
|
---|
14 | if (isScheduler(last)) {
|
---|
15 | scheduler = observables.pop();
|
---|
16 | if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {
|
---|
17 | concurrent = observables.pop();
|
---|
18 | }
|
---|
19 | }
|
---|
20 | else if (typeof last === 'number') {
|
---|
21 | concurrent = observables.pop();
|
---|
22 | }
|
---|
23 | if (scheduler === null && observables.length === 1 && observables[0] instanceof Observable) {
|
---|
24 | return observables[0];
|
---|
25 | }
|
---|
26 | return mergeAll(concurrent)(fromArray(observables, scheduler));
|
---|
27 | }
|
---|
28 | //# sourceMappingURL=merge.js.map
|
---|
Note:
See
TracBrowser
for help on using the repository browser.