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

> It would behave the same as `Array.from(uint8array)`. Perhaps we should add `ReadableStream.of(...chunks)` to mirror `Array.of(...elements)`?

I prefer this to making `rs.from(uint8array)` a special-case. If we special case buffer source types, then we also have to special case strings. Strings are arguably worse, since if you `rs.from('word')` then you get a stream of 4 1-character strings, which will appear to work but perform horribly.

Is there a way to express `of(...)` in WebIDL?

-- 
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#issuecomment-587363020

Received on Tuesday, 18 February 2020 09:30:07 UTC