Re: Push API - use parameterized Promise types

On Fri, 21 Mar 2014, at 2:28, Michael van Ouwerkerk wrote:
> In WebIDL we can now use parameterized Promise types:
> http://heycam.github.io/webidl/#idl-promise
> 
> My suggestion is that we make some minor changes in the Push API spec to
> take advantage of this. It reads much better and the prose can be
> simplified.
> 
> The following promise types:
> 
> interface PushManager {
>     Promise register ();
>     Promise unregister (DOMString pushRegistrationId);
>     Promise registrations ();
> };
> 
> Can be changed like this:
> 
> interface PushManager {
>     Promise<PushRegistration> register ();
>     Promise<DOMString> unregister (DOMString pushRegistrationId);
>     Promise<PushRegistration[]> registrations ();
> };
> 
> What do you think?

I wrote a quick patch for Respec (the tool being used for a few spec,
including that one) so it will correctly recognize parameterized
Promise: https://github.com/darobin/respec/pull/299 It's far from
perfect but hopefully Robin et al will help fix this quickly.

-- Mounir

Received on Thursday, 20 March 2014 18:45:42 UTC