@zcorky/compose
v1.0.0
Published
Compose functions
Downloads
7
Readme
Compose
Compose functions.
Install
$ npm install @zcorky/compose
Usage
// import
import compose from '@zcorky/compose';
// filter zero
const filter = data => data.filter(d => d.username === 'zero');
// map salary * 2
const map = data => data.map(d => (d.salary *= 2, d))
const resolve = compose(
filter,
map,
);
fetch('/api')
.then(res => res.json())
.then(
resolve,
);