Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8812070

Browse files
authored
"allows to" -> "allows us to" (2x)
1 parent 177f4b3 commit 8812070

File tree

1 file changed

+2
-2
lines changed
  • 1-js/12-generators-iterators/2-async-iterators-generators

1 file changed

+2
-2
lines changed

‎1-js/12-generators-iterators/2-async-iterators-generators/article.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ As we can see, the structure is similar to regular iterators:
109109

110110
1. To make an object asynchronously iterable, it must have a method `Symbol.asyncIterator` `(1)`.
111111
2. This method must return the object with `next()` method returning a promise `(2)`.
112-
3. The `next()` method doesn't have to be `async`, it may be a regular method returning a promise, but `async` allows to use `await`, so that's convenient. Here we just delay for a second `(3)`.
112+
3. The `next()` method doesn't have to be `async`, it may be a regular method returning a promise, but `async` allows us to use `await`, so that's convenient. Here we just delay for a second `(3)`.
113113
4. To iterate, we use `for await(let value of range)` `(4)`, namely add "await" after "for". It calls `range[Symbol.asyncIterator]()` once, and then its `next()` for values.
114114

115115
Here's a small cheatsheet:
@@ -268,7 +268,7 @@ So far we've seen simple examples, to gain basic understanding. Now let's review
268268
269269
There are many online services that deliver paginated data. For instance, when we need a list of users, a request returns a pre-defined count (e.g. 100 users) - "one page", and provides a URL to the next page.
270270
271-
This pattern is very common. It's not about users, but just about anything. For instance, GitHub allows to retrieve commits in the same, paginated fashion:
271+
This pattern is very common. It's not about users, but just about anything. For instance, GitHub allows us to retrieve commits in the same, paginated fashion:
272272
273273
- We should make a request to URL in the form `https://api.github.com/repos/<repo>/commits`.
274274
- It responds with a JSON of 30 commits, and also provides a link to the next page in the `Link` header.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /