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: Rick Waldron via GitHub <sysbot+gh@w3.org>
Date: Mon, 31 Oct 2016 19:28:40 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-257395113-1477942119-sysbot+gh@w3.org>
> However, spec doesn't specify what happens if developer caches 
reading and accesses it after stop is called.

Why would it? I would expect JavaScript semantics: 

```js
let raw = 1;
let reading = {
  get illuminance() {
    return raw;
  }
};

let als = {
  reading
};

let cached = als.reading;

console.log(cached.illuminance); // 1

als.reading = null;

console.log(cached.illuminance); // 1
```

-- 
GitHub Notification of comment by rwaldron
Please view or discuss this issue at 
https://github.com/w3c/ambient-light/issues/15#issuecomment-257395113 
using your GitHub account
Received on Monday, 31 October 2016 19:28:46 UTC

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