Re: [whatwg/streams] Add an example of a transform stream that replaces template tags (#846)

ricea commented on this pull request.



> +        controller.enqueue(chunk);
+      },
+
+      flush(controller) {
+        if (partialChunk.length > 0) {
+          controller.enqueue(partialChunk);
+        }
+      }
+    });
+  }
+</code></pre>
+
+This would be used in code like:
+<pre><code class="lang-javascript">
+  fetchEvent.respondWith(new Response(fetch(url).then(response =>
+    response.body.pipeThrough(LipFuzzTransform({ userName, displayName, icon, date })))));

I often get confused between stream and promise-for-stream. Which inspired me to write the second example in #847.

-- 
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/846#discussion_r147398565

Received on Friday, 27 October 2017 12:33:42 UTC