[whatwg/streams] [Question] Need help with a few lines in a demo (#855)

I was working on a new demo that demonstrates a real world usage of streams i.e. translating the text to emojis with the help of TransformStream and then displaying it on the UI. There's something that might help this application in reducing the jank which is happening because of emojifying large amounts of text.

An example in the demo might help, but I am confused about some lines and would love if anyone can clarify them.

https://github.com/whatwg/streams/blob/99ffba7a632c261566c12da60bb35800a42e3b3f/demos/tags/streaming-element-backpressure.js#L68-L72

What purpose does this serve at the start, I guess this `if` conditional is going to be executed only one time. Can we move this logic within the `start` function of writable stream too, since it seems to mean waiting out any frame that's to be executed first. 

2. Why are we writing into `iframe`, is it for performance reasons? 
https://github.com/whatwg/streams/blob/99ffba7a632c261566c12da60bb35800a42e3b3f/demos/tags/streaming-element-backpressure.js#L26-L39

-- 
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/issues/855

Received on Tuesday, 14 November 2017 01:19:15 UTC