W3C home > Mailing lists > Public > public-device-apis-log@w3.org > October 2016

Re: [ambient-light] What illuminance value should be reported for stopped sensor?

From: Alexander Shalamov via GitHub <sysbot+gh@w3.org>
Date: Mon, 31 Oct 2016 20:44:19 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-257415154-1477946656-sysbot+gh@w3.org>
@tobie, I understand how you want API to behave, it is just bit 
confusing, maybe 
[Sensor.reading](https://w3c.github.io/sensors/#sensor-reading) 
section needs to be reformulated somehow. Spec says that 
[Sensor.reading](https://w3c.github.io/sensors/#sensor-reading) points
 to current reading. Reading is an object, therefore if I write `let 
cached = Sensor.reading;` by default JS engines will make reference, 
as a web developer I might think that cached is pointing to current 
reading. While in your example, Sensor.reading getter makes a 
immutable clone of a current reading.

-- 
GitHub Notification of comment by alexshalamov
Please view or discuss this issue at 
https://github.com/w3c/ambient-light/issues/15#issuecomment-257415154 
using your GitHub account
Received on Monday, 31 October 2016 20:44:25 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 12:18:52 UTC