6a212a2aa8e2a4ef242da2be88dfd6a7b47b44e185c9247a18751b9e83bbf2301d5e161da4b727633179dae16759b3c0415bcf5dd7f2d1d283be1d0feeeabb 692 B

123456789101112131415
  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 = Infinity) {
  7. if (isFunction(resultSelector)) {
  8. return mergeMap((a, i) => map((b, ii) => resultSelector(a, b, i, ii))(innerFrom(project(a, i))), concurrent);
  9. }
  10. else if (typeof resultSelector === 'number') {
  11. concurrent = resultSelector;
  12. }
  13. return operate((source, subscriber) => mergeInternals(source, subscriber, project, concurrent));
  14. }
  15. //# sourceMappingURL=mergeMap.js.map