6 ms·
I have already fixed that, it was a typo, I meant following instead: var deferred = defer() // make promise var a = deferred.promise var b
by gozala 14y ago
I have already fixed that, it was a typo, I meant following instead:
var deferred = defer() // make promise
var a = deferred.promise
var b = sum(a, 1)
var c = sum(b, 5)
console.log(c) // eventually prints => 17
deferred.resolve(11) // fulfill promise
- jahewson 14y agoEdit: cool, it works!
- deleted 14y ago[deleted]
- streptomycin 14y agoThe typoed syntax was nicer than the real syntax, unfortunately.
- ricardobeat 14y agoYou were writing an article about it and didn't get it right on the first time - maybe that's the reason more people don't use it.
- skrebbel 14y agoThat, or a majority of the JS coding crowd is too novice to appreciate maintainable code better than copying and pasting "simple" plumbing all over the place.