Re: [whatwg/streams] A variety of clarity and documentation improvements (#875)

domenic commented on this pull request.



> +  <pre><code class="lang-javascript">
+  async function writeSuppliedBytesForever(writableStream, getBytes) {
+    const writer = writableStream.getWriter();
+
+    while (true) {
+      await writer.ready;
+
+      const bytes = getBytes();
+      writer.write(bytes).catch(() => {});
+    }
+  }
+  </code></pre>
+
+  Unlike the previous example, where—because we were always writing exactly
+  {{WritableStreamDefaultWriter/desiredSize|writer.desiredSize}} bytes each time—the
+  {{WritableStreamDefaultWriter/write()}} and {{WritableStreamDefaultWriter/ready}} promises were synchronized, in this

I think the advice holds even in the absence of that assumption, so I'll leave it out.

-- 
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/875#discussion_r168851812

Received on Friday, 16 February 2018 19:39:27 UTC