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

@tobie, this design would allow getting state of data, without 
allocation on changes. And would allow to subscribe to data changes.
Which ticks both use cases: async and sync.
And prevents allocations.

This is actually is a good option here.

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?

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

Received on Tuesday, 6 December 2016 15:12:12 UTC