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

RE: [battery] Should getBattery() always return the same promise?

From: Domenic Denicola <domenic@domenicdenicola.com>
Date: Tue, 1 Jul 2014 20:48:46 +0000
To: Mounir Lamouri <mounir@lamouri.fr>, "public-device-apis@w3.org" <public-device-apis@w3.org>
Message-ID: <1404247727332.9533@domenicdenicola.com>
Makes sense to me. +1
________________________________________
From: Mounir Lamouri <mounir@lamouri.fr>
Sent: Tuesday, July 01, 2014 06:03
To: public-device-apis@w3.org
Cc: Domenic Denicola
Subject: [battery] Should getBattery() always return the same promise?

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?

-- Mounir

Received on Tuesday, 1 July 2014 20:49:20 UTC

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