Re: [w3c/screen-orientation] Resolving the promise after the change event is fired (#147)

@kenchris, the closest I get in the Promises Guide is this section:
https://www.w3.org/2001/tag/doc/promises-guide#one-time-events


> The prototypical example of such an "event" is a loaded indicator: a resource such as an image, font, or even document, could provide a loaded property that is a promise that becomes fulfilled only when the resource has fully loaded (or becomes rejected if there’s an error loading the resource).

The above suggests that the **event occurs**, and, as a result the promise is resolved and rejected based on what the result is.  

> Then, authors can always queue up actions to be executed once the resource is ready by doing resource.loaded.then(onLoaded, onFailure). 

The above follows... 

> This will work even if the resource was loaded already, queueing a microtask to execute onLoaded. This is in contrast to an event model, where if the author is not subscribed at the time the event fires, that information is lost.

... and so on... 

Anyway, will file a bug :) 


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/screen-orientation/pull/147#issuecomment-460477881

Received on Tuesday, 5 February 2019 01:17:24 UTC