Re: [whatwg/streams] ReadableStream should be an async iterable (#778)

[Here](https://github.com/es-git/es-git/blob/master/packages/http-transport/ts/utils/streamToAsyncIterator.ts) is the implementation that I currently use to convert a ReadableStream to an async iterator, and it works well enough for what I need from it. I don't think I ever cancel iterating the stream though, maybe only when throwing an exception in a loop. 

I also agree that it should be auto cancelled and auto closed, as (async) iterators most often are single consumer. I think the api should be optimized for single consumer and require a small wrapper for cases where it should not automatically close. That seems like the most common scenario, and it doesn't make it impossible to get the multi consumer scenario to work. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/778#issuecomment-371726571

Received on Friday, 9 March 2018 06:34:59 UTC