W3C home > Mailing lists > Public > public-web-perf@w3.org > February 2014

Re: [Navigation Error Logging] Use promises instead of callbacks?

From: Jake Archibald <jakearchibald@google.com>
Date: Fri, 14 Feb 2014 18:15:38 +0000
Message-ID: <CAPy=JoozBDo-u8xQ_cmvY14NCcy8berePYLGbvE8-uk8x=8JQw@mail.gmail.com>
To: Arvind Jain <arvind@google.com>
Cc: Jake Archibald <jakearchibald@chromium.org>, ttuttle <ttuttle@chromium.org>, public-web-perf <public-web-perf@w3.org>, Domenic Denicola <domenic@domenicdenicola.com>
Looks good.

The other methods on
https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationErrorLogging/Overview.html#extensions-performance-interface,
are they synchronous? If not, is there any benefit to knowing when they
complete?

Also, minor nit: in the example, rather than

var p = window.performance.getNavigationErrors();
p.then...

I'd just do

window.performance.getNavigationErrors().then...;
OK Done.  Please check:
https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationErrorLogging/Overview.html


On Tue, Feb 11, 2014 at 2:24 AM, Jake Archibald
<jakearchibald@chromium.org>wrote:

> +1
>
> Any async success (and optionally, failure) API should use promises.
>
>
> On Tue, Feb 11, 2014 at 6:40 AM, Arvind Jain <arvind@google.com> wrote:
>
>> Does anyone else have an opinion? Should I go ahead and change
>> getNavigationErrors to return a promise?
>>
>> https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationErrorLogging/Overview.html
>>
>>
>> On Tue, Feb 4, 2014 at 2:35 PM, ttuttle <ttuttle@chromium.org> wrote:
>>
>>> Hi,
>>>
>>> At Domenic Denicola's suggestion, can we have getNavigationErrors
>>> return a promise instead of a callback?  It should fail if the site
>>> has never registered for error logging.
>>>
>>> Thanks,
>>>
>>> ttuttle
>>>
>>
>>
>
Received on Friday, 14 February 2014 18:16:05 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:04:38 UTC