W3C home > Mailing lists > Public > public-device-apis@w3.org > August 2014

Re: DAP-ISSUE-166: Should getBattery() always return the same promise?

From: Mounir Lamouri <mounir@lamouri.fr>
Date: Fri, 08 Aug 2014 23:12:49 +1000
Message-Id: <1407503569.1902068.150564233.1E16D942@webmail.messagingengine.com>
To: "Kostiainen, Anssi" <anssi.kostiainen@intel.com>, Device APIs Working Group <public-device-apis@w3.org>
On Fri, 8 Aug 2014, at 19:47, Kostiainen, Anssi wrote:
> I see no downsides in doing this, thus I suggest we change to the
> following:
> 
> [[
> 
> * Let /promise/ be a newly created Promise and return it.
> 
> ]]
> 
> Into:
> 
> [[
> 
> * If there is an initialized-but-unresolved Promise object returned by
> getBattery(), let /promise/ be that Promise object.
> * Otherwise, let /promise/ be a newly created Promise.
> * Return /promise/.
> 
> ]]
> 
> For the contest, please see:
> 
> https://dvcs.w3.org/hg/dap/raw-file/default/battery/Overview.html#the-navigator-interface
> 
> All - please report any bugs in the algorithm, and let us know if you
> have any concerns with this change. I’ll land this change later if I hear
> no concerns.

Why not simply returning the same Promise all the time instead of only
returning un-resolved promises?

-- Mounir
Received on Friday, 8 August 2014 13:13:19 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:33:11 UTC