Re: [whatwg/streams] Add fetch-progress examples to demos page (#893)

Looks good.

The examples would be cleaner with TransformStream, but unfortunately no browser is shipping it yet. You could be really concise, something like

```javascript
fetchEvent.respondWith(new Response(response.body.pipeThrough(new TransformStream({
  transform(chunk, controller) {
    loaded += chunk.length;
    progress({loaded, total});
    controller.enqueue(chunk);
  }
})), response));
```

(totally untested).

It would be great if you could add web-platform-tests for the incompatibilities between browsers that you found. This would allow the various browsers to track their compatibility issues. I think the issue with `abort()` not being called when a fetch is cancelled in Chrome is being tracked here: https://bugs.chromium.org/p/chromium/issues/detail?id=638494.

-- 
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/893#issuecomment-370348134

Received on Monday, 5 March 2018 08:47:06 UTC