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: Tobie Langel via GitHub <sysbot+gh@w3.org>
Date: Mon, 31 Oct 2016 20:54:37 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-257417774-1477947274-sysbot+gh@w3.org>
> 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.

Heh. yeah. :) There's a lot of reformulation needed. That said, the 
[update current reading 
algorithm](https://w3c.github.io/sensors/#update-current-reading) is 
quite clear about this.

> 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 

That's a good point in terms of meeting developer expectations. 
@rwaldron, WDYT?

Should we use method instead, e.g.:


> While in your example, Sensor.reading getter makes a immutable clone
 of a current reading.

That's not what happens, because if it did: `als.reading === 
als.reading;` would return `false` and we want it to return `true`.

GitHub Notification of comment by tobie
Please view or discuss this issue at 
using your GitHub account
Received on Monday, 31 October 2016 20:54:43 UTC

This archive was generated by hypermail 2.4.0 : Monday, 4 July 2022 12:47:52 UTC