dot-curry

non-intrusive, chainable curry function

Usage no npm install needed!

<script type="module">
  import dotCurry from 'https://cdn.skypack.dev/dot-curry';
</script>

README

Build Status

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