G. Stoynev
G. Stoynev

Reputation: 7791

Find which observable dependency change fired computed evaluation; dump the context

If I set a break point inside a knockout.js computed, I see two frames in the call stack (using Chrome's F12 facility)

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

Answers (1)

Brandon
Brandon

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

Related Questions