3 ms·
It seems incredibly fragile, better to just use some kind of compile-to-js language. IcedCoffeeScript, Clojurescript, Gopherscript and more all make it possible
by adrusi 11y ago
It seems incredibly fragile, better to just use some kind of compile-to-js language. IcedCoffeeScript, Clojurescript, Gopherscript and more all make it possible to avoid callbacks in a cleaner way, with fewer restrictions and probably better performance. Babel has experimental support for es7 async functions, if you really want to write javascript code.
- voxtex 11y agoI've found using promises with generators yields code very similar to async/await, without relying on experimental features. https://github.com/tj/co https://github.com/tj/co or https://github.com/petkaantonov/bluebird/blob/master/API.md#promisecoroutinegeneratorfunction-generatorfunction---function https://github.com/petkaantonov/bluebird/blob/master/API.md#...