What happens when promise is yielded in javascript?
Didn't find full answer .. What happens when promise is yielded? Is such construction var p = new Promise() p.resolve(value) function * (){ yield p } equivalent to function * (){ yield value } ? UPDATE How to mix different styles of async programming, for example for such framework as koa? Koa middlewares are working with generators, but there are lots of good packages which are promise-based (sequelize for ex.) As Felix says, a promise is just another value to be yielded. However, there is a style of writing asynchronous code which makes use of yielded promises in a particular way. This