4 ms·
I'm not a js guy, but this concept sounds a lot like Twisted's (python) concept of "deferreds". The idea is that you "defer" caring about some asynchronous pro
by Patrick_Devine 13y ago
I'm not a js guy, but this concept sounds a lot like Twisted's (python) concept of "deferreds". The idea is that you "defer" caring about some asynchronous process, and then attach "callbacks" and "errbacks" to the "deferred". You essentially create a chain of callbacks or errbacks which gets called depending on if a callback is fired or an exception is raised. Overall it's a pretty great concept, but debugging can be a real pain.
- domenicd 13y agoYup, from what I recall of history both Twisted Deferreds and JavaScript promises have their heritage in E's promises.
- davedx 13y agoYup. jQuery: http://api.jquery.com/category/deferred-object/ http://api.jquery.com/category/deferred-object/
- spion 13y agoDebugging with Bluebird (mentioned in the article) is not a pain because it stitches stack traces across events for you when you run it in development mode :)