- From: Adam Rice <notifications@github.com>
- Date: Fri, 13 Oct 2017 04:23:20 +0000 (UTC)
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 13 October 2017 04:23:43 UTC
ricea 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
Is it possible to have a separate id for the buffering example without disrupting the readability of this section too much?
--
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#pullrequestreview-69123034
Received on Friday, 13 October 2017 04:23:43 UTC