W3C home > Mailing lists > Public > public-secondscreen@w3.org > July 2015

[presentation-api] Update PresentationAvailability.value and fire the change event in the same task

From: Philip Jägenstedt via GitHub <sysbot+gh@w3.org>
Date: Tue, 07 Jul 2015 14:59:18 +0000
To: public-secondscreen@w3.org
Message-ID: <issues.opened-93550903-1436281157-sysbot+gh@w3.org>
foolip has just created a new issue for 
https://github.com/w3c/presentation-api:

== Update PresentationAvailability.value and fire the change event in 
the same task ==
http://w3c.github.io/presentation-api/#interface-presentationavailability

> Queue a task to fire an event named change at availability object.

Changing the observable attribute and firing the event in separate 
tasks allows for the new value to be seen before the event is fired. 
This kind of mismatch can be tricky, for example it means that there's
 no guarantee that looking at the `value` attribute in the event 
handler there's no guarantee that one will see alternating states, for
 example if a device is available for just a millisecond it ought to 
be possible to observe `value` to be false both before and in both of 
the events.

Maybe just fire the event after resolving the promise?

See https://github.com/w3c/presentation-api/issues/143
Received on Tuesday, 7 July 2015 14:59:20 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 7 July 2015 14:59:20 UTC