by Roboprog · 7y ago · 0 comments
Actually, I’ve moved away from OOP in general in my JavaScript, only as a last resort. (Not going to put in long comment from tablet screen...)
That said, there is a Stage 1 TC39 proposal for partial application. https://github.com/tc39/proposal-partial-application
I have been using Ramda’s R.partial() function a bit, as well as some in-house stuff (e.g. - to generate 0-arity event handlers), but this would be a very helpful feature, particularly once IDE recognition becomes widespread.
Background: suite of related projects started in early 2015, ES5 on IE11 kind of limitations... (recently started using a transpiler for syntactic sugar)
const foo = (a: number, b: number): number => { /*...*/ }
to const foo = (a: number) => (b: number): number => { /*...*/ }