W3C home > Mailing lists > Public > public-device-apis@w3.org > June 2015

Re: [sensors] Dependency on [DOM] due to inheriting from EventTarget

From: Rick Waldron via GitHub <sysbot+gh@w3.org>
Date: Thu, 11 Jun 2015 20:52:51 +0000
To: public-device-apis@w3.org
Message-ID: <issue_comment.created-111274650-1434055970-sysbot+gh@w3.org>
> Note that there are no DOM dependenices in the example as far as I 
can tell.

Don't get hung up on this. The **only** reason that EventTarget is 
being used is because it's the closest thing to EventEmitter. If that 
existed, we wouldn't have this problem, because:

var location = new Sensor.GPS();

location.once("change", function() {
  // Located. 
  console.log(location.latitude, location.longitude);

GitHub Notif of comment by rwaldron
See https://github.com/w3c/sensors/issues/21#issuecomment-111274650
Received on Thursday, 11 June 2015 20:52:52 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:54:05 UTC