Reputation: 7791
If I set a break point inside a knockout.js computed, I see two frames in the call stack (using Chrome's F12 facility)
function evaluateImmediate()
at var newValue = readFunction.call(evaluatorFunctionTarget);
I believe knockout defers/throttles computed evaluation using a timeout mechanism. They must be storing the trigger(s) that caused the computed to re-evaluate, yes? Where?
Is there also a "remembered" context that is available to the evaluating computed? Where?
Upvotes: 7
Views: 674
Reputation: 39222
If you are using the throttle
extender then yes the evaluation is deferred. But the reason the evaluation was triggered is not stored. It is unusual, when using Knockout, to care about which dependency triggered your evaluation.
Upvotes: 4