Find what observed changes in the dependence cause a calculated estimate; reset context

If I set a breakpoint inside the computed knockout.js, I see two frames in the call stack (using the Chrome F12 tool)

  • my calculation (debugger stopped at breakpoint)
  • knockout function evaluateImmediate() in var newValue = readFunction.call(evaluatorFunctionTarget);

I believe subtraction subtraction / throttling is calculated using a timeout mechanism. They must store the trigger (s) due to which it is calculated for revaluation, right? Where?

Is there also a “remembered” context that is computable? Where?

+6
source share
1 answer

If you are using a throttle expander, then yes, the evaluation is deferred. But the reason the evaluation was called is not saved. When using Knockout, it’s unusual to keep track of which dependency caused your rating.

+3
source

Source: https://habr.com/ru/post/953355/