ISSUE-166: Should getBattery() always return the same promise?
Should getBattery() always return the same promise?
- State:
- PENDING REVIEW
- Product:
- Battery Status API
- Raised by:
- Mounir Lamouri
- Opened on:
- 2014-08-04
- Description:
- http://lists.w3.org/Archives/Public/public-device-apis/2014Jul/0003.html
[[
Hi,
When I wrote the getBattery() prose, I made it so that getBattery()
would return a new promise every time it is called but it would always
return the same BatteryManager when the promise is resolved.
I realised that this requirement probably doesn't make much sense and we
might want to spec getBattery() as returning always the same promise. In
other words, navigator.getBattery() === navigator.getBattery(). The
intent isn't really to get the equality but that way, we simplify the
implementation because implementing this only require to keep track of
that one promise.
WDYT?
]]
- Related Actions Items:
ACTION-709 on Anssi Kostiainen to Follow upon on issue-166 and http://lists.w3.org/archives/public/public-device-apis/2014jul/0003.html - due 2014-08-14, closed- Related emails:
- [minutes] draft minutes from DAP 2014-08-21 call (from w3c@fjhirsch.com on 2014-08-21)
- [admin] Agenda - DAP Distributed Meeting 21 August 2014 (from w3c@fjhirsch.com on 2014-08-19)
- Re: DAP-ISSUE-166: Should getBattery() always return the same promise? (from anssi.kostiainen@intel.com on 2014-08-18)
- RE: DAP-ISSUE-166: Should getBattery() always return the same promise? (from cathy.chan@nokia.com on 2014-08-11)
- Re: DAP-ISSUE-166: Should getBattery() always return the same promise? (from w3c@fjhirsch.com on 2014-08-11)
- RE: DAP-ISSUE-166: Should getBattery() always return the same promise? (from cathy.chan@nokia.com on 2014-08-11)
- Re: DAP-ISSUE-169: Battery API needs to be more event driven and async, less device centric. [Battery Status API] (from anssi.kostiainen@intel.com on 2014-08-11)
- Re: DAP-ISSUE-166: Should getBattery() always return the same promise? (from anssi.kostiainen@intel.com on 2014-08-11)
- dap commit: Make getBattery() always return the same promise (addresses ISSUE-166). (from cvsmail@w3.org on 2014-08-11)
- Re: DAP-ISSUE-166: Should getBattery() always return the same promise? (from mounir@lamouri.fr on 2014-08-08)
- Re: DAP-ISSUE-166: Should getBattery() always return the same promise? (from anssi.kostiainen@intel.com on 2014-08-08)
- draft minutes from today's teleconference, 7 Aug 2014 (from w3c@fjhirsch.com on 2014-08-07)
- [admin] Agenda - DAP Distributed Meeting 7 August 2014 (from w3c@fjhirsch.com on 2014-08-04)
- [battery] Battery Issue summary and status (from w3c@fjhirsch.com on 2014-08-04)
- DAP-ISSUE-166: Should getBattery() always return the same promise? (from sysbot+tracker@w3.org on 2014-08-04)
Related notes:
+1 http://lists.w3.org/Archives/Public/public-device-apis/2014Jul/0006.html
Frederick Hirsch, 4 Aug 2014, 19:30:41See related issue, ISSUE-167: "Should Promises be used in Battery API"
https://www.w3.org/2009/dap/track/issues/167
Resolved with https://dvcs.w3.org/hg/dap/rev/27d83813c582
Frederick Hirsch, 11 Aug 2014, 19:40:50Display change log