W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2014

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

From: Tobie Langel <tobie.langel@gmail.com>
Date: Wed, 18 Jun 2014 12:21:46 +0200
Message-ID: <CAMK=o4fgp5LP-sum1PpbcpsiiX9=5zwudouT2X4S3JpgiONBMw@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: Jussi Kalliokoski <jussi.kalliokoski@gmail.com>, WHATWG <whatwg@whatwg.org>
On Wed, Jun 18, 2014 at 12:08 PM, Jonas Sicking <jonas@sicking.cc> wrote:

> On Mon, Jun 16, 2014 at 6:57 PM, Jussi Kalliokoski
> <jussi.kalliokoski@gmail.com> wrote:
> >
> > var doesFetchSupportJson = function () {
> >     return fetch("data:application/json;base64,e30=").then(function
> > (response) {
> >         return response.body.to("json");
> >     }).then(function () {
> >         return true;
> >     }).catch(function () {
> >         return false;
> >     });
> > };
>
> I agree with this. We're told time and again that feature detection is
> important, as is the ability to polyfill. It seems like the current
> API fails both these tests.
>

Likewise.

What's the rationale for using a string here instead of separate methods?

--tobie
Received on Wednesday, 18 June 2014 10:22:12 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:21 UTC