rxjs-async-map
Map an observable using an async function with a configurable concurreny level, while preserving element order.
Installation
rxjs-async-map
is available via npm or yarn:
npm i --save rxjs-async-map
yarn add rxjs-async-map
Usage
import { of } from 'rxjs/observable/of';
import { asyncMap } from 'rxjs-async-map';
const myPromise = val =>
new Promise(resolve => setTimeout(() => resolve(`Result: ${val}`), Math.random() * 1000));
const source = of(1, 2, 3);
const example = source.pipe(asyncMap(myPromise, 2));
const subscribe = example.subscribe(val => console.log(val));
License
MIT