4 ms·
Yes, there are numerous libraries that do this. For instance, Tamejs is now rolled into CoffeeScript, creating IcedCoffeeScript. I didn't think CoffeeScript c
by doublerebel 14y ago
Yes, there are numerous libraries that do this. For instance, Tamejs is now rolled into CoffeeScript, creating IcedCoffeeScript. I didn't think CoffeeScript could get better, but it does.
In addition, there is:
Q (implementation of the CommonJS Promises spec)
https://github.com/kriskowal/q https://github.com/kriskowal/q
Streamline.js
https://github.com/Sage/streamlinejs https://github.com/Sage/streamlinejs
Await.js (New, inspired by Tame/IcedCS)
https://github.com/greim/await.js https://github.com/greim/await.js
jQuery.Deferred
http://api.jquery.com/category/deferred-object/ http://api.jquery.com/category/deferred-object/
...And less current libs like Node-promises and FuturesJS.
Here's a comparison from last year:
http://www.infoq.com/articles/surviving-asynchronous-programming-in-javascript http://www.infoq.com/articles/surviving-asynchronous-program...
And IcedCS's debut on HN:
http://news.ycombinator.com/item?id=3522839 http://news.ycombinator.com/item?id=3522839
In JS devs seem to like to reinvent the wheel. I'd love to see the community rally around one of these solutions, instead of creating new half-finished ones and abandoning them. I'm partial to IcedCS because it's the least verbose, and it also works as a lib outside of CS. The Promises spec has been (partially) implemented by jQuery and I'm sure is here to stay.
Elm's syntax won't easily translate to any existing solution I'm aware of. It is a nice research project, but I will be sticking with established, well-tested methods instead of risking my business on another half-finished wheel.