googlearchive / TemplateBinding

TemplateBinding Prolyfill
290 stars 61 forks source link

Support Promises as model properties #207

Open jyasskin opened 9 years ago

jyasskin commented 9 years ago

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.

cc @slightlyoff