xen-orchestra/@vates/compose
2021-02-18 10:39:57 +01:00
..
index.js feat(compose): new lib to compose functions 2021-02-18 10:39:57 +01:00
index.spec.js feat(compose): new lib to compose functions 2021-02-18 10:39:57 +01:00
package.json feat(compose): new lib to compose functions 2021-02-18 10:39:57 +01:00
README.md feat(compose): new lib to compose functions 2021-02-18 10:39:57 +01:00
USAGE.md feat(compose): new lib to compose functions 2021-02-18 10:39:57 +01:00

@vates/compose

Package Version License PackagePhobia Node compatibility

Compose functions from left to right

Install

Installation of the npm package:

> npm install --save @vates/compose

Usage

import { compose } from '@vates/compose'

const add2 = x => x + 2
const mul3 = x => x * 3

// const f = x => mul3(add2(x))
const f = compose(add2, mul3)

console.log(f(5))
// → 21

Contributions

Contributions are very welcomed, either on the documentation or on the code.

You may:

  • report any issue you've encountered;
  • fork and create a pull request.

License

ISC © Vates SAS