Re: [whatwg/streams] Standard text for TransformStream (#811)

domenic commented on this pull request.



> -  constructor. One use of identity transforms is to add additional buffering to a pipe. In this example we add extra
-  buffering between <code>readableStream</code> and <code>writableStream</code>.
+  One use of <a>identity transform streams</a> is to easily convert between readable and writable streams. For example,
+  the {{fetch()}} API accepts a readable stream <a for="request" lt="body">request body</a>, but it can be more
+  convenient to write data for uploading via a writable stream interface. Using an identity transform stream addresses
+  this:
+
+  <pre><code class="lang-javascript">
+    const { writable, readable } = new TransformStream();
+    fetch("...", { body: readable }).then(response => /* ... */);
+
+    writable.write(new Uint8Array([0x73, 0x74, 0x72, 0x65, 0x61, 0x6D, 0x73, 0x21]));
+    writable.close();
+  </code></pre>
+
+  Another use of identity transform streams is to add additional buffering to a <a>pipe</a>. In this example we add

Sure, we can just make it another `<div>`, not a big deal I think.

-- 
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/811#discussion_r144465055

Received on Friday, 13 October 2017 04:43:23 UTC