- From: <Frederick.Hirsch@nokia.com>
- Date: Fri, 9 Sep 2011 12:15:19 +0000
- To: <dom@w3.org>
- CC: <Frederick.Hirsch@nokia.com>, <anssi.kostiainen@nokia.com>, <public-device-apis@w3.org>, <annevk@opera.com>
+1 for the reasons Dom mentions.
if there is no battery would it make sense for b to be null?
regards, Frederick
Frederick Hirsch
Nokia
On Sep 9, 2011, at 2:46 AM, ext Dominique Hazael-Massieux wrote:
> Le vendredi 09 septembre 2011 à 09:01 +0300, Anssi Kostiainen a écrit :
>> Here's a summary of discussed alternatives:
>>
>> var b = new BatteryStatusEventSource();
>> b.onbatterystatus = function () {};
>>
>> navigator.battery.start();
>> navigator.battery.onbatterystatus = function () {};
>>
>> var b = navigator.getBattery();
>> b.onbatterystatus = function () {};
>>
>> Which one is your favorite, and why?
>
> I think the last one is probably my favorite, but mostly for cosmetic
> reason: it doesn't add a constructor (which for a singleton seems
> awkward), and it doesn't need the start() method (which reads weird: it
> feels like you're starting the battery itself).
>
> Dom
>
>
>
Received on Friday, 9 September 2011 12:16:32 UTC