merge.js 866 B

123456789101112131415161718192021222324252627
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.merge = void 0;
  4. var mergeAll_1 = require("../operators/mergeAll");
  5. var innerFrom_1 = require("./innerFrom");
  6. var empty_1 = require("./empty");
  7. var args_1 = require("../util/args");
  8. var from_1 = require("./from");
  9. function merge() {
  10. var args = [];
  11. for (var _i = 0; _i < arguments.length; _i++) {
  12. args[_i] = arguments[_i];
  13. }
  14. var scheduler = args_1.popScheduler(args);
  15. var concurrent = args_1.popNumber(args, Infinity);
  16. var sources = args;
  17. return !sources.length
  18. ?
  19. empty_1.EMPTY
  20. : sources.length === 1
  21. ?
  22. innerFrom_1.innerFrom(sources[0])
  23. :
  24. mergeAll_1.mergeAll(concurrent)(from_1.from(sources, scheduler));
  25. }
  26. exports.merge = merge;
  27. //# sourceMappingURL=merge.js.map