Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
cutler
9y ago
0 comments
Share
This killed it for me:
class Callback
.....
this.then = g => new Callback(callback =>
Can't we just keep OOP out of FP?
0 comments
default
newest
oldest
homami
9y ago
Using class enables us to chain instances naturally in JS syntax, especially because JS lacks infix functions or custom operators. o1.then(f).then(g).run(cb)
BinaryIdiot
9y ago
You can avoid the class syntax here and write a function to return the same if you prefer.
j
/
k
navigate · click thread line to collapse