Async Iterators
Learn how to use a generator in place of a standard iterator.
We'll cover the following...
The iterators we’ve seen so far return a value synchronously from their next()
method. However, in JavaScript and especially in Node.js, it’s very common to have iterations over items that require an asynchronous operation to be produced.
Imagine, for example, to iterate over the requests received by an HTTP server, over the results of an SQL query, or over the elements of a paginated REST API. In all those situations, it’d be handy to be able to return a promise from the next()
method of an iterator, or even better, use the async/await construct.
Well, that’s exactly what async iterators ...