On 09/22/2015 09:49 AM, Zibi Braniecki wrote:
There seem to be an interesting section in Promises doc from 2001 about 
multi-state promises - 
https://www.w3.org/2001/tag/doc/promises-guide#state-transitions

That document is from 2015 ;)



One of the things that we are working on is a spec for loading localization 
resources into HTML, which resembles the example from this chapter.

I was thinking about something like:

linkElement.ready((resource) => {
   console.log(resource.text());
});

and make when the language changes, I'd update the url in the link and the 
callback would get called again when its loaded.



The example in that chapter is "This property should return the same promise every time it is retrieved, until the image moves backward from the loaded state into the unloaded state. Once that occurs, a new promise is created, representing the next transition to loaded."
So a new promise would be created.


Is there any evolution of that proposal?
What's the current thinking about solving such cases?


Why not use events for that? There is nothing wrong with events , and 
https://www.w3.org/2001/tag/doc/promises-guide#when-not-to-use



zb.


_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to