dot-curry
v0.0.2
Published
non-intrusive, chainable curry function
Downloads
4
Maintainers
Readme
dot-curry
non-intrusive, chainable curry function
Getting Started
Install it to your project:
npm install --save dot-curry
Require it in your file:
var curry = require( 'dot-curry' );
Add the curry method to a function you wish to curry:
function f( a, b, c ) {
return a ? b : c;
}
f.curry = curry;
Use the curry method when needed:
f( 0, 1, 2); // 2
f.curry( 0 )( 1, 2 ); // 2
f.curry( 0 ).curry( 1 )( 2 ); // 2
f.curry( 0 ).curry( 1 ).curry( 2 )(); // 2
var f0 = f.curry( 0 );
f0( 1, 2 ); // 2