Re: [sensors] Add solution for one-shot readings

@tobie I've been out of the loop for a while, but is the `rAF` example
 realistic (and fundamental)? I'm presuming that it does not involve 
synchronous reading, so you're just getting whatever cached value 
there is.

```js
requestAnimationFrame(function frame() {
  console.log(sensor.cache.lastValue);
  requestAnimationFrame(frame);
});
```

Regarding more advanced primitives, well, you gotta keep the pressure 
up :) Also: you can reproduce the same behaviour with `EventTarget` 
(albeit more verbosely).

Other than that, I wonder if you're not mixing the caching behaviour 
into the sensor too much? You have pretty granular caching needs, it 
strikes me as strange to have them built into the sensor itself. By 
splitting up the responsibility you can design both separately; you 
can also think about cases in which you would make the cache 
user-replaceable so that devs could fine-tune the caching behaviour 
they want.

-- 
GitHub Notification of comment by darobin
Please view or discuss this issue at 
https://github.com/w3c/sensors/issues/88#issuecomment-193281097 using 
your GitHub account

Received on Monday, 7 March 2016 14:53:06 UTC