2 ms·
It does. The fetch response object exposes a `ReadableStream` through the `body` property, which you can loop through with a `for await ... of` loop. On each it
by runarberg 8y ago
It does. The fetch response object exposes a `ReadableStream` through the `body` property, which you can loop through with a `for await ... of` loop. On each iteration, simply update your progress.
- tcd 8y agoSee [1] for a demo [1]:https://tejasq.github.io/basically-streams/examples/fetch/ https://tejasq.github.io/basically-streams/examples/fetch/
- aaaaaaaaaaab 8y agoYep, that’s a cute hack. Now what would be the equivalent of that for file upload? There’s no such API for fetch() because there’s no writeable body stream for requests. QED