mbest / knockout-deferred-updates

Deferred Updates plugin for Knockout <=3.3.0
http://mbest.github.io/knockout-deferred-updates/
134 stars 23 forks source link

re-evaluation only for change events (but still queue for dirty) #4

Closed mbest closed 12 years ago

mbest commented 12 years ago

If/when SteveSanderson/knockout#458 becomes part of Knockout, this plugin will need to be modified to the cases where a computed observable is re-evaluated, but its value doesn't change (and thus it doesn't trigger a change event).

My idea is that the Deferred Updates plugin will watch for both dirty and change events for computed dependencies. The dirty event will add the computed to the queue, but only a change event will actually trigger re-evaluation (by setting _needsEvaluation = true).