Y
Hacker News
new
|
ask
|
show
|
jobs
by
asprouse
2812 days ago
CO
https://github.com/tj/co
in popularized this technique a few years ago. It implements something similar to the function you present here. Babel actually transforms async/await to generators (
https://babeljs.io/docs/en/babel-plugin-transform-async-to-g...
) when targeting environments that don't have native async/await support.