News for hackers. Stuff that matters.
Re:Implementing Async and Await with Generators by asprouse on Wednesday October 10, 2018 @10:50AM (#18185389)
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.