fn-compose
A simple function to compose an arbitrary number of functions from right to left, or left to right.
install
npm install --save fn-compose
usage
var compose = { return a * 2 } { return a - 1 } mul2Sub1 = ; ; //=> 9
There is also a left to right mode, which is exported as ltr
:
var compose = ltr // Notice the .ltr { return a * 2 } { return a - 1 } mul2Sub1 = ; ; //=> 8
license
MIT