Re: [whatwg/streams] ReadableStream.from(asyncIterable) (#1083)

@MattiasBuelens commented on this pull request.



> @@ -787,6 +796,19 @@ option. If {{UnderlyingSource/type}} is set to undefined (including via omission
      |underlyingSource|, |underlyingSourceDict|, |highWaterMark|, |sizeAlgorithm|).
 </div>
 
+<div algorithm>
+ The static <dfn id="rs-from" method for="ReadableStream">from(|asyncIterable|)</dfn> method steps
+ are:
+
+ 1. Return ? [$ReadableStreamFromIterable$](|asyncIterable|).
+</div>
+
+<div algorithm>
+ The static <dfn id="rs-of" method for="ReadableStream">of(...|chunks|)</dfn> method steps are:
+
+ 1. Return ? [$ReadableStreamFromIterable$](|chunks|).

(Oh wow, that was a fast review. 😅)

Hmm, fair point. I believe the argument behind `of()` was because people might accidentally use `ReadableStream.from(uint8Array)` and get a stream of individual bytes instead of a stream with one byte chunk ([comment](https://github.com/whatwg/streams/issues/1018#issuecomment-587350179)). But then again, that's easily fixed with `ReadableStream.from([uint8Array])`.

I'll remove `of()` for now.

-- 
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/pull/1083#discussion_r527260330

Received on Thursday, 19 November 2020 22:58:37 UTC