Re: [w3c/FileAPI] Streams are hot, FileReader.readAs____ is not (#40)

Returning a new object each time from a getter is an anti-pattern. We want `obj.x === obj.x` to be true. (It's okay to update `obj.x` at well-defined times, but that would still mean the comparison yields true.)

Given that, duplication coupled with partial modification (perhaps `stream()` rather than `body`; and no need for `blob()`, `bodyUsed`, or `formData()` I suspect) seems like the way to go.

There might be ways to share a bunch of underlying infrastructure though and even some of the IDL if we split the mixin. I'd be open to such a refactoring of Fetch to enable this functionality on `Blob` objects.

(I guess the one question I have is whether it makes sense to have blobs that once read can be collected. But I guess that would bring back `close()` and all its issues.)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/FileAPI/issues/40#issuecomment-461338696

Received on Thursday, 7 February 2019 09:07:00 UTC