1-js/12-generators-iterators/2-async-iterators-generators: fix typo
This commit is contained in:
parent
6a5f14da41
commit
ca92aed539
1 changed files with 1 additions and 1 deletions
|
@ -310,7 +310,7 @@ async function* fetchCommits(repo) {
|
|||
|
||||
1. We use the browser `fetch` method to download from a remote URL. It allows to supply authorization and other headers if needed, here GitHub requires `User-Agent`.
|
||||
2. The fetch result is parsed as JSON, that's again a `fetch`-specific method.
|
||||
3. We can get the next page URL from the `Link` header of the response. It has a special format, so we use a regexp for that. The next page URL may look like this: `https://api.github.com/repositories/93253246/commits?page=2`, it's generatd by GitHub itself.
|
||||
3. We can get the next page URL from the `Link` header of the response. It has a special format, so we use a regexp for that. The next page URL may look like this: `https://api.github.com/repositories/93253246/commits?page=2`, it's generated by GitHub itself.
|
||||
4. Then we yield all commits received, and when they finish -- the next `while(url)` iteration will trigger, making one more request.
|
||||
|
||||
An example of use (shows commit authors in console):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue