Skip to content

Commit 94b4200

Browse files
committed
doc: Refer to proposal-async-iterator-helpers
1 parent dfcf0d2 commit 94b4200

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,12 @@ Array.fromAsync([], 1);
399399
## Other proposals
400400
401401
### Relationship with iterator-helpers
402-
The [iterator-helpers][] proposal has toArray, which works with both sync and
403-
async iterables. The following pairs of lines are equivalent:
402+
The [iterator-helpers][] and [async-iterator-helpers][] proposal define
403+
Iterator.toArray and AsyncIterator.toArray. The following pairs of lines are
404+
equivalent:
404405
405406
[iterator-helpers]: https://github.com/tc39/proposal-iterator-helpers
407+
[async-iterator-helpers]: https://github.com/tc39/proposal-async-iterator-helpers
406408
407409
```js
408410
// Array.from
@@ -422,10 +424,8 @@ Array.fromAsync(asyncIterable, mapfn)
422424
AsyncIterator(asyncIterable).map(mapfn).toArray()
423425
```
424426
425-
toArray overlaps with both Array.from and Array.fromAsync. This is okay. They
426-
can coexist. If we have to choose between having toArray and having fromAsync,
427-
then we should choose fromAsync. We already have Array.from. We should match
428-
the existing language precedent.
427+
Iterator.toArray overlaps with Array.from, and AsyncIterator.toArray overlaps
428+
with Array.fromAsync. This is okay: they all can coexist.
429429
430430
A [co-champion of iterable-helpers agrees][tc39/proposal-iterator-helpers#156]
431431
that we should have both or that we should prefer Array.fromAsync: “I

0 commit comments

Comments
 (0)