4 ms·
I wish Typescript had support for partial function application, since I use that much more than “Executioner” classes. Actually, I’ve moved away from OOP in ge
by Roboprog 8y ago
I wish Typescript had support for partial function application, since I use that much more than “Executioner” classes.
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...)
- paulddraper 8y agoOutside of type annotations, Typescript never supports syntax that isn't in an ECMAScript standard or a popular proposal. That said, there is a Stage 1 TC39 proposal for partial application. https://github.com/tc39/proposal-partial-application https://github.com/tc39/proposal-partial-application
- Roboprog 8y agoThanks for the tip. 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)
- javadocmd 8y agoPartial function application would be sweet. I wind up manually currying a lot of functions and readability starts to get sketchy. const foo = (a: number, b: number): number => { /*...*/ } to const foo = (a: number) => (b: number): number => { /*...*/ }