mergeMap.js 793 B

12345678910111213141516
  1. import { map } from './map';
  2. import { innerFrom } from '../observable/innerFrom';
  3. import { operate } from '../util/lift';
  4. import { mergeInternals } from './mergeInternals';
  5. import { isFunction } from '../util/isFunction';
  6. export function mergeMap(project, resultSelector, concurrent) {
  7. if (concurrent === void 0) { concurrent = Infinity; }
  8. if (isFunction(resultSelector)) {
  9. return mergeMap(function (a, i) { return map(function (b, ii) { return resultSelector(a, b, i, ii); })(innerFrom(project(a, i))); }, concurrent);
  10. }
  11. else if (typeof resultSelector === 'number') {
  12. concurrent = resultSelector;
  13. }
  14. return operate(function (source, subscriber) { return mergeInternals(source, subscriber, project, concurrent); });
  15. }
  16. //# sourceMappingURL=mergeMap.js.map