#async-Await ≈ Generators + #promises
▻https://hackernoon.com/async-await-generators-promises-51f1a6ceede2?source=rss----3a8144eabfe3-
In this article I will describe how the ES2017 async functions are essentially a play between two older #javascript features: generators and promises, both of which were added earlier to the language in the ES2016 specification.Before you start reading ..This article is not an introduction to promises, generators or async functions.The only goal of this article is to describe how async functions can be realised using promises and generators.It does not offer any opinion whether async functions are better or worse than the other approach.The code examples used in this article are ingeniously contrived for easier explanation. They are not meant for any serious use.But why .. ?Since async functions are now natively supported, what is the need to understand how they work?Well, apart from the (...)