tc39 / proposal-array-from-async

Draft specification for a proposed Array.fromAsync method in JavaScript.
http://tc39.es/proposal-array-from-async/
BSD 3-Clause "New" or "Revised" License
179 stars 13 forks source link

Relationship with iterator-helpers #3

Closed js-choi closed 3 years ago

js-choi commented 3 years ago

The exciting iterator-helpers proposal has a similar toArray method that overlaps with this. (toArray already overlaps with Array.from too.) See #1.

My preference is to keep both toArray and Array.fromAsync (Array.from being a fait accompli). But we can explore this more before both proposals advance further. CC: @codehag

bathos commented 3 years ago

I think both should exist, too. One reason is that they’re not quite equivalent: Array.fromAsync will work with any object implementing the async iterable contract regardless of whether it inherits from AsyncIteratorPrototype.

js-choi commented 3 years ago

See tc39/proposal-iterator-helpers#156.