Re: [Sensor API] Simplified version without discovery

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
landed.

/ Jonas

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