http://jsbin.com/meganuceli/5/edit has an example based on the <core-ajax> demo that tries to bind a template to a Promise-valued model. Obviously that doesn't work, and users have to instead do something like http://jsbin.com/meganuceli/6/edit that assigns the model after the Promise resolves. However, this is vulnerable to races where a user changes the state of the application, the application updates the Promises that fill in the model, but then an outdated Promise resolves after the up-to-date one does, and overwrites its output: http://jsbin.com/hesivoseyu/3/edit
It would be nice for Polymer to support Promises directly so that it would take less code to fill in the model and so that this race would happen less often.
http://jsbin.com/meganuceli/5/edit has an example based on the
<core-ajax>
demo that tries to bind a template to aPromise
-valued model. Obviously that doesn't work, and users have to instead do something like http://jsbin.com/meganuceli/6/edit that assigns the model after thePromise
resolves. However, this is vulnerable to races where a user changes the state of the application, the application updates thePromise
s that fill in the model, but then an outdatedPromise
resolves after the up-to-date one does, and overwrites its output: http://jsbin.com/hesivoseyu/3/editIt would be nice for Polymer to support Promises directly so that it would take less code to fill in the model and so that this race would happen less often.
cc @slightlyoff