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

Trying to understand the Promise usage in the battery API

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Wed, 29 Jul 2015 13:27:08 -0400
To: public-device-apis@w3.org
Message-ID: <55B90CEC.5060106@mit.edu>
I was asked to review a patch to Gecko to align our implementation of 
the battery API to http://www.w3.org/TR/2014/CR-battery-status-20141209/ 
and I'm not sure I understand the intent of the Promise usage in that 

The Promise just returns a manager object; this doesn't particularly 
need to be an async operation (though it can be one, of course).  But 
all the operations for querying the actual hardware state are then 
synchronous, and _those_ are what I would expect one might want to do 

I looked through the list archives, but can't seem to find the rationale 
for the current design; if there is one there, I would appreciate a 
pointer to it.

Received on Wednesday, 29 July 2015 17:27:30 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:54:06 UTC