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

On 7/30/15 6:29 AM, Андрей Логвинов wrote:
> I may be wrong but looking at the Chromium implementation, it seems that
> the promise is used to avoid blocking or reporting out-of-thin-air
> values until the initial battery status is received from the browser
> process. After that, cached values are returned until the next status
> update is received (asynchronously).

Ah, I see.  The getters don't actually get the current information but 
whatever the information was as of the last time one of the tasks 
defined in 
http://www.w3.org/TR/battery-status/#the-batterymanager-interface ran...

I guess that makes sense, as long as you don't care about the current 
information.

-Boris

Received on Thursday, 30 July 2015 14:51:04 UTC