1.0.1 • Published 10 years ago
@f/upon v1.0.1
upon
Run a function upon some arguments
Installation
$ npm install @f/uponUsage
var upon = require('@f/upon')
upon(4)(isEven) === true
map(upon(4), [isEven, isOdd]) === [true, false]This is very useful as a primitive for applying a list of functions to a value or set of values. It's also nice generally whenever you know what you want to process before you know how you want to process it.
API
upon(...args)(fn)
args- An arbitrary argument list to be passed tofn.fn- The function that you want to apply toargs.
Returns: A function that accepts fn and passes args to it.
License
MIT