Re: [whatwg] Fetch: use separate methods instead of one `to` method in FetchBodyStream

On Mon, Jun 16, 2014 at 3:00 PM, Anne van Kesteren <annevk@annevk.nl> wrote:

> On Mon, Jun 16, 2014 at 12:57 PM, Jussi Kalliokoski
> <jussi.kalliokoski@gmail.com> wrote:
> > Another bad example of using strings for these kind of things, from much
> > closer, is XHR's responseType where it's excruciatingly painful to try to
> > detect for example whether responseType "json" (it may throw when you set
> > it, it may result in the `error` event or it may silently fail and set
> the
> > JSON as string to response) is supported, let alone "arraybuffer".
>
> Those sound like bugs in the implementation. If a given value is not
> supported, setting should not happen. (And in the case of to(), it'll
> reject.)
>

Bugs indeed.


>
> > Feature detection is not the only concern though, another one is that it
> > encourages putting a lot of complexity behind one flag (just like
> > responseType) which is likely to lead to interoperability issues.
>
> It's not that much complexity really.
>

Fair enough. However, I'm curious as to what's the rationale behind having
it all behind one function as opposed to a function per action?

Cheers, Jussi


>
>
> --
> http://annevankesteren.nl/
>

Received on Monday, 16 June 2014 13:04:04 UTC