Skip to content

AutoSponge/dot-curry

Repository files navigation

Build Status Code Climate Test Coverage

browser support

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

About

non-intrusive, chainable curry function

Resources

License

Stars

Watchers

Forks

Packages

No packages published