[whatwg] Web Notification: API inconsistency

Tab Atkins Jr. jackalmage at gmail.com
Fri Aug 23 09:33:27 PDT 2013


On Fri, Aug 23, 2013 at 6:16 AM, Anne van Kesteren <annevk at annevk.nl> wrote:
> On Fri, Aug 23, 2013 at 1:16 PM, Jeremie Patonnier
> <jeremie.patonnier at gmail.com> wrote:
>> The spec define two static methods: `requestPermission` and `get`
>> I'm a bit puzzled because `requestPermission` expect a callback function
>> where `get` return a `Promise`.
>
> It's not clear to me we can change the design of requestPermission()
> at this point. I think end-user notifications have been shipping for a
> while now... We could maybe upgrade it at some point to also return a
> promise, dunno.

If a function currently takes a callback argument and returns void,
it's trivial to upgrade it to instead make the callback optional and
return a promise when it's not passed.

~TJ



More information about the whatwg mailing list