A functional utility for doing partial application in JavaScript
JavaScript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.travis.yml
LICENSE
README.md
package.json
partial.d.ts
partial.js
test.js

README.md

Partial

NPM version Build status Test coverage Greenkeeper badge

Partially apply a function by pre-filling some of its arguments and without changing the this context.

Installation

npm install util-partial --save

Usage

var partial = require('util-partial');

var add = function (a, b) {
  return a + b;
};

var add5 = partial(add, 5);

add5(10); //=> 15
add5(20); //=> 25
add5(30); //=> 35

Typings

Includes a TypeScript type definition.

License

MIT