Re: [sensors] Undefined values makes GS a pain to work with using TypeScript

> Is this a static, class-side property? If so, what happens if there are more than one instance of a given Sensor?

If there is more than one instance, then we could cache the last reading and return that, and only add default values when all sensors call stop().

> I can easily see end developers getting tripped up on this, with code that forgets to check the "hasReading" signaling property :\

That is just as bad today. You can easily forget to check whether .z is set or not. I know because I have done it when doing sensor fusion.

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

Received on Tuesday, 19 September 2017 07:53:07 UTC