3 ms·
> `async function foo() { const a = await bar();` vs `co(function* foo() { const a = yield bar();` isn't really with adding extra syntax for. Except in the lat
by gobengo 7y ago
> `async function foo() { const a = await bar();` vs `co(function* foo() { const a = yield bar();` isn't really with adding extra syntax for.
Except in the latter you have to bring your own `co(...)` function. Baking it into the syntax means you don't need that as a library.
- jkoudys 7y agoNot really - you have your own promise implementation as `Promise`. Bluebird made `Promise.coroutine`, and that could've gone into the main Promise implementation.