W3C home > Mailing lists > Public > public-device-apis@w3.org > August 2014

Ambient light API redesign

From: Anne van Kesteren <annevk@annevk.nl>
Date: Tue, 26 Aug 2014 11:43:18 +0200
Message-ID: <CADnb78jHd=EZ6jY6DU3gzZvwRfBbOcrRnKw-+JYFKevtN1+vUw@mail.gmail.com>
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.

Received on Tuesday, 26 August 2014 09:43:46 UTC

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