Supercharge your functions by giving them the ability to auto-curry.
Note: This library actually uses partial application internally and not currying. So, yes, the name is a misnomer. It is the result of my incorrect understanding of the concepts when I wrote the library. It is still perfectly usable and is used in production.
npm install auto-curry --save
node, you can just
In the browser, you can use
- directly by using
var cu = ;var add =;var messWithThis =;var map =;var x = a: ;console; //[2, 3, 4]console; //[2, 3, 4]console; //[1, 2, 3]
var cu = windowautoCurry; //using it off the globalvar add =;var messWithThis =;var map =;var x = a: ;console; //[2, 3, 4]console; //[2, 3, 4]console; //[1, 2, 3]
- Now, if the function passed to
auto-curryhas an arity of one, the function itself is returned. Earlier this was only for zero arity functions.