[whatwg/streams] ReadableStream.from(X) (#1018)

It would be good to have a convenience method to create a ReadableStream in a DWIM-ish fashion from something else.

Logic being something like
1. If X is an async iterable, then create a stream and enqueue each value as a chunk, applying flow control, closing when the async iterable is done.
2. Else if X is an iterable, then create a stream and enqueue each value as a chunk, closing when the iterable is done.
3. Else if X is a Blob, return the original value of Blob.prototype.stream called on X.
4. Else create a stream, enqueue X, and close it.

-- 
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/1018

Received on Tuesday, 15 October 2019 05:22:40 UTC