From searching for practical applications a while back, I understood currying as a way to create a new function with fixed values rather than fixed arguments. Meaning if you had a function take arguments FIRST and SECOND, with FIRST being computationally expensive, currying would allow you to create a new function with the slower part pre-calculated.
But after brief testing I’m unsure that’s the case. It seems the examples might’ve been referring to the argument itself being a computationally expensive operation, in which case—and going back to your example—you could save the computation’s result to a variable beforehand and use that.
For example, if you want to pass an object to onClick event:
const handleOnClick = _.memoize(
(myObj) =>
(evt) => {
// you can do something with myObj here
});
// on render
return <button onClick={handleOnClick(myObj)} >Try it</button>;
Memoize works on class component but I don't know if it works on function component.