Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@zcorky/compose

zcorky2MIT1.0.0TypeScript support: included

Compose functions

readme

Compose

NPM version Coverage Status Dependencies Build Status license issues

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,
  );

Relatived