map-each-pipe
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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

Package Sidebar

Install

npm i map-each-pipe

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

5.34 kB

Total Files

9

Last publish

Collaborators

  • camilbis