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

Re: [sensors] Call 'onchange' only when data changes and considering frequency hint

From: Mikhail Pozdnyakov via GitHub <sysbot+gh@w3.org>
Date: Fri, 24 Mar 2017 10:12:27 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-288983066-1490350342-sysbot+gh@w3.org>
@tobie I think we're in agreement that change of timestamp does mean that the reading is different and `onchange` should be called for it, therefore I'm modifying the issue title.

The problem with the notification frequency (https://github.com/w3c/sensors/issues/152#issuecomment-259947092) however remains. In order to solve it, could we embark on the cached reading per Sensor instance (instead of shared reading)? What I mean is:

1) a sensor (as a concept) still has shared _sensor readings_
2) each Sensor instance reads the _sensor readings_ considering its individual frequency hint, sends `onchange` and caches the obtained reading.

Thus we sync the Sensor instance's data (returned from getters) with its notifications; also we obviate side effects when other Sensor instances of the same type and with different frequencies appear.

-- 
GitHub Notification of comment by pozdnyakov
Please view or discuss this issue at https://github.com/w3c/sensors/issues/152#issuecomment-288983066 using your GitHub account
Received on Friday, 24 March 2017 10:12:32 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 12:18:52 UTC