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

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