xtodo js promise

This puzzled me for a decade. Node js non-blocking/async 2012, fad or progress? In fact, most programer don't know it before node js made it popular in around 2010. But it exists in programing languages, in niche tasks of io/events/threads coding.

work in progress

js promise

js promise 2025-05-24 31d5b
js promise 2025-05-24 31d5b
js promise 2025-05-24 314bd
js promise 2025-05-24 314bd
js promise 2025-05-24 313b0
js promise 2025-05-24 313b0
  • The history goes back to MochiKit implementing Twisted (a Python library) Deferreds in JS.
  • Dojo Toolkit borrowed the concept from MochiKit (I think MochiKit's author donated the code to Dojo).
  • Promises ended up being a subset of Deferred functionality.
  • Links to follow:
  • Also, @kriszyp, @slightlylate, @phiggins, @dylans, @ttrenka, and many others I can't remember were instrumental in getting Deferreds and Promises into JS 20+ years ago.
  • It was an honor working with them back then.

js promise 2025-05-24 317cf
js promise 2025-05-24 317cf
  • Manuel Simoni
  • @msimoni
  • Fundamentally, it's a way to make callbacks (which is the only way you can do IO in JS) more palatable, by wrapping them in a convenient object.
  • There's quite a bit going on; look into a pure-JS implementation of the "Promises/A+" spec such as this one:
  • https://github.com/abdulapopoola/Adehun/blob/master/adehun.js
js promise adehun.js 2025-05-24 31835
js promise adehun.js 2025-05-24 31835

promisesaplus

promisesaplus 2025-05-24 2337b
promisesaplus 2025-05-24 2337b

dojo Deferred

dojo deferred 2025-05-24 3145f
dojo deferred 2025-05-24 3145f https://dojotoolkit.org/reference-guide/1.10/dojo/Deferred.html