- From: Anne van Kesteren <annevk@annevk.nl>
- Date: Tue, 26 Aug 2014 11:43:18 +0200
- To: public-script-coord <public-script-coord@w3.org>
- Cc: "public-device-apis@w3.org" <public-device-apis@w3.org>, Anssi Kostiainen <anssi.kostiainen@intel.com>, Doug Turner <dougt@mozilla.com>, Rick Waldron <waldron.rick@gmail.com>
In https://bugzilla.mozilla.org/show_bug.cgi?id=1057185 we discovered that the current API for ambient lights is lacking and would require hacks to addEventListener() to salvage. Since the API is not widely adopted (only by Firefox per caniuse) we'd rather come up with a better solution. Perhaps even establishing a pattern for how we should expose hardware sensors to the web. Perhaps something like this: var as = new AmbientSensor() var currentVal = await as.value as.onvaluechange = ... as long as you have a reference to the object or the object has a listener attached it cannot be GC'd. -- http://annevankesteren.nl/
Received on Tuesday, 26 August 2014 09:43:47 UTC