googlearchive / TemplateBinding

TemplateBinding Prolyfill
290 stars 56 forks source link

fixes #174 -- minimize calls to discardChanges for if/bind/repeat #180

Closed jmesserly closed 10 years ago

jmesserly commented 10 years ago

inspired by #176, this accomplishes a similar ends. The main difference is instead of using CompoundObserver.value_ directly, we thread through the value of if/bind/repeat that we got from open. It also ensures that if if/bind/repeat changes, we still use discardChanges to get the updated value of the other one.

Verified that the test reproduces #174. The code was calling discardChanges() for the "bound" and "predicate" observers 3 to 4 times, now it's once each.

arv commented 10 years ago

LGTM

jmesserly commented 10 years ago

Thank you!