Re: [whatwg/streams] What is the expected behaviour of .pipeThrough()? (#765)

@domenic 

Browsing https://github.com/whatwg/streams/blob/1e13713cc8671fcd029f0a34b6b4af55962f73af/demos/transforms/parse-json.js revealed solution, that is to pass transformed value to `.enqueue()` method of `TransformStreamDefaultController`

```
const {readable, writable} = ts = new TransformStream({
  transform(chunk, c) {
    console.log(chunk, c); 
    c.enqueue(chunk.map(c => c * 10)); // {"value":[10,20,30],"done":false}
  }
});
```
which yields `{"value":[10,20,30],"done":false}` at `.then()` chained to `.read()` of returned `ReadableStream` of `.pipeThrough()`.

-- 
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/765#issuecomment-323610147

Received on Sunday, 20 August 2017 20:34:00 UTC