Open michaelficarra opened 4 months ago
Pro is that you can call it for something which you know to be either an iterator or async iterator but not which, I guess? But that's a pretty unusual case, and in any case you could just do AsyncIterator.from(x)
, so I don't see much reason to add this.
I suppose one could do ?.toAsync()
?
In plenary, during the unordered async iterator helpers discussion, @erights preferred including this method.
AsyncIterator.prototype
will have all the same method names asIterator.prototype
. But this proposal also addstoAsync
toIterator.prototype
. So willAsyncIterator.prototype
have atoAsync
that basically no-ops? What are the pros and cons?This has consequences on the design of unordered async iterator helpers and whether their prototype has an
unordered
method or whether that just gets added toAsyncIterator.prototype
.