w3c / FileAPI

File API
https://w3c.github.io/FileAPI/
Other
104 stars 44 forks source link

Refactor text() et al to share more infrastructure with Fetch #133

Open annevk opened 5 years ago

annevk commented 5 years ago

Andrea implemented these methods in Firefox and ended up using a shared abstraction with our code for Fetch.

If I look at https://fetch.spec.whatwg.org/#concept-body-consume-body and https://w3c.github.io/FileAPI/#text-method-algo side-by-side it seems quite doable to have less duplication here.

(We might want to point out the one major difference though, which is that File API will create an endless series of streams for the same underlying data where in Fetch that'd require explicit cloning.)