3 ms·
One example is it would allow you to pass arguments to callbacks other than those passed by whoever is using the callback (my example because it's the relevant
by bpicolo 11y ago
One example is it would allow you to pass arguments to callbacks other than those passed by whoever is using the callback (my example because it's the relevant part I use most frequently)
There are infinite examples for this sort of thing in real development scenarioes
- Zalastax 11y agoIn 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.
- amalcon 11y agoIt 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.
- bpicolo 11y agoWhy 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)
- Zalastax 11y agoI 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.
- bpicolo 11y agoAhh, I see what you meant. That should work with a correct currying implementation for sure