4 ms·
Good article but no mention of Promise.coroutine [1] which I find unfortunate. It allows for a synchronous looking code using generators and yield. I've been us
by joeyrobert 10y ago
Good article but no mention of Promise.coroutine [1] which I find unfortunate. It allows for a synchronous looking code using generators and yield. I've been using it on express servers (in lieu of Koa) and it's worked great with promise-based ORMs (BookshelfJS). Also allows for use of native try/catch.
[1] http://bluebirdjs.com/docs/api/promise.coroutine.html http://bluebirdjs.com/docs/api/promise.coroutine.html
- farnsworth 10y agoCool, like async/await in Typescript and which I think is coming in ES7.