1.1.0 • Published 11 months ago

map-each-pipe v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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 }]
1.1.0

11 months ago

1.0.0

11 months ago