Skip to content

CamilBis/map-each-pipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A simple RxJS pipe to map each element of an array emitted by an observable.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published