| Thanks, this explanation is very helpful. One last question, when you say: > Because this is just an integer comparison, it's very very fast on modern JavaScript VMs, even if you have lots of data on screen. I don't follow, what is an integer comparison? Don't you have to compare the reference's value to the previous value? Meaning you need to get that reference's value. That reference could be somewhat expensive. Imagine if it is a property getter that calls into a few more functions. This seems like the disadvantage of not using KVO, you don't know a property's value without asking for it. with KVO the value is cached and only changes when the underlying dependency tree changes. Of course vdom works without this, so it can't be that bad. But I'm guessing you've found a clever way to avoid having to call out to get the reference's value to compare, so what is it? :-) And I'll definitely read me in those docs, thanks! EDIT: Probably should have read the docs first. A global counter id! Very clever... I wonder if you could get away with just a lastModified though. The view layer could keep track of the last time it updated and then just compare lastModified, if something has changed since the last time it updated then it must have changed too. Going to think some more about this, thanks for the puzzle! |