On Mon, Jun 23, 2014 at 5:11 PM, Adam Barth <w...@adambarth.com> wrote:
> XMLHttpRequest isn't particularly cleanly layered.  It's sounds like
> you're not overly concerned about layering, which is probably fine.

I think I see what you mean. If you wanted to implement this in terms
of JavaScript then indeed you would end up importing several modules
other than the fetch module to implement these methods. E.g. encoding,
for asText, filesystem and MIME for asBlob, and encoding and JSON for
asJSON. For asHTML you'd need encoding and HTML.

This seems fine to me.

However, I could see it instead has to go the other way around.
Instead of having a bunch of methods on stream to convert it into
various other pieces. Other pieces could have ways of dealing with
streams. That might make coding a bit more awkward though.


Reply via email to