callback-chainer
This module returns the result from callbacks in a specific order (array of functions), one feeding the next.
Installation
> npm install callback-chainer
Usage
Params: [array of functions with desired order] and arg
callbackChainer([fn1, fn2, fn3, ...])(arg)
const add = { return i + 2; };const mul = { return 2 * i; };const sub = { return i - 5; }; 8 // ==> 15
Raison d'être
Functions are super cool in JS but in the end what matters is how you call them within your logic. In the case you need a number of functions to be called in a specific order this module might be a help.
Super Light (7 sloc). No dependencies.