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

ricea commented on this pull request.



> +      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 })))));
+</code></pre>
+
+<div class="note">For simplicity, <code>LipFuzzTransform()</code> performs unescaped text substitutions. In real

Done.

-- 
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_r147398597

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