compose-funcs
Compose functions (i.e. f(g(x)) -> (f ∘ g)(x)). Returns a function with correct length and a descriptive name
Features
Installation
Install compose-funcs
using npm:
npm install --save compose-funcs
Usage
const compose = require('compose-funcs');
const add = (a, b) => a + b;
const double = a => a * 2;
const doubleAndAdd = compose(double, add);
doubleAndAdd(3, 4);
API
compose(...functions)
Name | Type | Description |
---|
functions | Function | Any number of functions to compose to a new function |
Returns: Function
. The composed function.
License
MIT © Joakim Carlstein