Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

In what way is it better than partial() from rambda or underscore? I have tried to see the potential in currying but gave up when I couldn't create a function with no parameters without calling it.


view as:

It isn't better; it's the same thing less a few minor details. _.partial is a from of currying. It's just a matter of which syntax you prefer.

Why did you think you needed it in the case where you had a function that didn't need parameters? That sort of relinquishes the point of currying. (Should just be passing the function itself)

I had a function taking parameters and wanted a function without parameters. Using this style the function would be called immediately when all parameters are supplied, instead of in the callback as I intended.

Ahh, I see what you meant. That should work with a correct currying implementation for sure

Legal | privacy