map-each-pipe
v1.1.0
Published
A simple RxJS pipe to map each element of an array emitted by an observable.
Downloads
4
Maintainers
Readme
map-each-pipe
A simple RxJS pipe to map each element of an array emitted by an observable.
Installation
npm install map-each-pipe
Usage
import { of } from "rxjs";
import { mapEach } from "map-each-pipe";
const source$ = of([{ id: 1 }, { id: 2 }]);
const result$ = source$.pipe(mapEach((item) => ({ ...item, id: item.id * 2 })));
result$.subscribe(console.log);
// Output: [{ id: 2 }, { id: 4 }]