Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Internals of Async / Await in JavaScript. Parent comment
The generator function keeps track of the current page.
This allows you to use a `for await` loop which is quite concise.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
You can do it without generator functions, but generator functions allows the caller to not have to know about the underlying pagination API.
There are no comments on this comment yet.
The generator function keeps track of the current page.
This allows you to use a `for await` loop which is quite concise.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
You can do it without generator functions, but generator functions allows the caller to not have to know about the underlying pagination API.