1.0.1 • Published 8 years ago

@f/upon v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 years ago

upon

Build status Git tag NPM version Code style

Run a function upon some arguments

Installation

$ npm install @f/upon

Usage

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 to fn.
  • fn - The function that you want to apply to args.

Returns: A function that accepts fn and passes args to it.

License

MIT