This聽is something that聽I鈥檇聽expect to聽be聽supported, since聽Promise.{allSettled,all,race} return聽a聽Promise, so聽they鈥檙e聽essentially already聽asynchronous.
It makes sense for all, but not so much allSettled or race (or any) - the expectation is that the promises returned by the async iterator settle in the order they're emitted (that's how async generators work, certainly), and that if one of them rejects then any subsequent promises just hold { done: true }.
It does not always make sense for promise-returning APIs which take iterables to also take async iterables.
Anyway, the iterator helpers proposal adds %AsyncIterator.prototype%.toArray(), which allows you to get a promise for a list out of an async iterator, which is a similar to what Promise.all does.
Closing this as resolved, but @ExE-Boss if there's something else feel free to reopen.
Most helpful comment
It makes sense for
all, but not so muchallSettledorrace(orany) - the expectation is that the promises returned by the async iterator settle in the order they're emitted (that's how async generators work, certainly), and that if one of them rejects then any subsequent promises just hold{ done: true }.It does not always make sense for promise-returning APIs which take iterables to also take async iterables.
Anyway, the iterator helpers proposal adds
%AsyncIterator.prototype%.toArray(), which allows you to get a promise for a list out of an async iterator, which is a similar to whatPromise.alldoes.