W3C home > Mailing lists > Public > public-device-apis@w3.org > May 2012

Re: [Sensor API] Simplified version without discovery

From: Jonas Sicking <jonas@sicking.cc>
Date: Thu, 10 May 2012 22:15:43 -0700
Message-ID: <CA+c2ei9r7QMxkGmh3XEY9icSN+2k5vL-W53K3ZzXJBjKVkxkYg@mail.gmail.com>
To: "Tran, Dzung D" <dzung.d.tran@intel.com>
Cc: "public-device-apis@w3.org" <public-device-apis@w3.org>
On Tue, Apr 10, 2012 at 8:53 AM, Tran, Dzung D <dzung.d.tran@intel.com> wrote:
> Hello All,
> I have checked in my latest sensor API without discovery at:
>     http://dvcs.w3.org/hg/dap/raw-file/tip/sensor-api/Overview.html
> This can be used for further discussion on the sensor API.

I definitely don't think we should do that. addEventListener is a well
established API which has been defined in DOM Events and now DOM Core.
We should not alter its behavior to take something other than a
function which receives an Event object. Note that ES6 will provide a
nicer syntax which will work great with events:

window.addEventListener("proximitysensor", function({ value, min, max }) {
  alert("value is " + value);
  alert("min is " + min);
  alert("max is " + max);

You can try this already in Firefox. It works with all event handlers,
including the proximity/ambient light sensor events we recently

/ Jonas
Received on Friday, 11 May 2012 05:16:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:32:37 UTC