merge.js 613 B

12345678910111213141516171819
  1. import { mergeAll } from '../operators/mergeAll';
  2. import { innerFrom } from './innerFrom';
  3. import { EMPTY } from './empty';
  4. import { popNumber, popScheduler } from '../util/args';
  5. import { from } from './from';
  6. export function merge(...args) {
  7. const scheduler = popScheduler(args);
  8. const concurrent = popNumber(args, Infinity);
  9. const sources = args;
  10. return !sources.length
  11. ?
  12. EMPTY
  13. : sources.length === 1
  14. ?
  15. innerFrom(sources[0])
  16. :
  17. mergeAll(concurrent)(from(sources, scheduler));
  18. }
  19. //# sourceMappingURL=merge.js.map