Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
cutler
9y ago
0 comments
Save
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
2 comments · 2 top-level
top
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