Re: [sensors] Don't allocate response objects to avoid triggering GC

> Although, this pattern will only work for singleton sensor types - 
there is only one gyro, and one accelerometer ever?
Does Sensors API assumes that there might be multiple sensors of the 
same type?
Lets say there are two controllers, like HTC Vive Controller, so you 
can have multiple attached. Does Sensors API covers this types of 
sensors too?

Yes, via [identifying 
parameters](https://w3c.github.io/sensors/#identifying-parameters) 
which are sensor type specific, e.g. (completely made-up identifying 
parameters):

```js
let gyro = new Gyroscope({
    frequency: 240,
    external: true, // identifying parameter
    hand: "right"   // identifying parameter
});
```
> One slight concern, with sensors that have frequency that affects 
the "accumulated" data. For example accelerometer would not just get 
current state, but accumulated between pulls data? If that is the 
case, then with sync use cases, pulling could be sync too.

I've punted on dealing with accumulate date for now, tbh. I wan't to 
make sure we don't design something that makes this impossible in the 
future, however, so suggestions are welcome.

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

Received on Tuesday, 6 December 2016 15:41:56 UTC