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

Re: Trying to understand the Promise usage in the battery API

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Wed, 29 Jul 2015 16:27:47 -0400
To: Marcos Fábio Pereira <marcos.pereira@signove.com>
Cc: "public-device-apis@w3.org" <public-device-apis@w3.org>
Message-ID: <55B93743.8040508@mit.edu>
On 7/29/15 3:46 PM, Marcos Fábio Pereira wrote:
> Maybe in the future some hardware implementation needs some time to
> retrieve the battery level

But retrieving the battery level is sync in the spec.  Once you have the 
BatteryManager, you just hold on to it and call the sync "level" getter 
any time you want.

> and create the instance of BatteryManager in
> the first call of getBattery().

The BatteryManager is supposed to return the current level, not the 
level as of when it was created, right?

Received on Wednesday, 29 July 2015 20:28:17 UTC

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