mergeMap.js 976 B

1234567891011121314151617181920
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.mergeMap = void 0;
  4. var map_1 = require("./map");
  5. var innerFrom_1 = require("../observable/innerFrom");
  6. var lift_1 = require("../util/lift");
  7. var mergeInternals_1 = require("./mergeInternals");
  8. var isFunction_1 = require("../util/isFunction");
  9. function mergeMap(project, resultSelector, concurrent) {
  10. if (concurrent === void 0) { concurrent = Infinity; }
  11. if (isFunction_1.isFunction(resultSelector)) {
  12. return mergeMap(function (a, i) { return map_1.map(function (b, ii) { return resultSelector(a, b, i, ii); })(innerFrom_1.innerFrom(project(a, i))); }, concurrent);
  13. }
  14. else if (typeof resultSelector === 'number') {
  15. concurrent = resultSelector;
  16. }
  17. return lift_1.operate(function (source, subscriber) { return mergeInternals_1.mergeInternals(source, subscriber, project, concurrent); });
  18. }
  19. exports.mergeMap = mergeMap;
  20. //# sourceMappingURL=mergeMap.js.map