Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

merge.js 902B

1234567891011121314151617181920212223
  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