merge.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. "use strict";
  2. var __read = (this && this.__read) || function (o, n) {
  3. var m = typeof Symbol === "function" && o[Symbol.iterator];
  4. if (!m) return o;
  5. var i = m.call(o), r, ar = [], e;
  6. try {
  7. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  8. }
  9. catch (error) { e = { error: error }; }
  10. finally {
  11. try {
  12. if (r && !r.done && (m = i["return"])) m.call(i);
  13. }
  14. finally { if (e) throw e.error; }
  15. }
  16. return ar;
  17. };
  18. var __spreadArray = (this && this.__spreadArray) || function (to, from) {
  19. for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
  20. to[j] = from[i];
  21. return to;
  22. };
  23. Object.defineProperty(exports, "__esModule", { value: true });
  24. exports.merge = void 0;
  25. var lift_1 = require("../util/lift");
  26. var argsOrArgArray_1 = require("../util/argsOrArgArray");
  27. var mergeAll_1 = require("./mergeAll");
  28. var args_1 = require("../util/args");
  29. var from_1 = require("../observable/from");
  30. function merge() {
  31. var args = [];
  32. for (var _i = 0; _i < arguments.length; _i++) {
  33. args[_i] = arguments[_i];
  34. }
  35. var scheduler = args_1.popScheduler(args);
  36. var concurrent = args_1.popNumber(args, Infinity);
  37. args = argsOrArgArray_1.argsOrArgArray(args);
  38. return lift_1.operate(function (source, subscriber) {
  39. mergeAll_1.mergeAll(concurrent)(from_1.from(__spreadArray([source], __read(args)), scheduler)).subscribe(subscriber);
  40. });
  41. }
  42. exports.merge = merge;
  43. //# sourceMappingURL=merge.js.map