W3C home > Mailing lists > Public > public-device-apis-log@w3.org > September 2017

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

From: Kenneth Rohde Christiansen via GitHub <sysbot+gh@w3.org>
Date: Tue, 19 Sep 2017 07:53:15 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-330459380-1505807584-sysbot+gh@w3.org>
> 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

This archive was generated by hypermail 2.4.0 : Monday, 4 July 2022 12:47:54 UTC