简体   繁体   English

有没有办法调试哪个依赖项导致调用自定义Knockout绑定的更新函数?

[英]Is there a way to debug which dependency causes a custom Knockout binding's update function to be called?

Is there a (relatively) easy way to debug which dependency causes the update callback of a custom Knockout binding to be called? 是否有(相对)简单的方法来调试哪个依赖项导致调用自定义Knockout绑定的更新回调? My problem is that a binding is receiving updates repeatedly, and I can't see what is triggering these updates. 我的问题是绑定正在反复接收更新,我无法看到触发这些更新的内容。 I'm thinking there's an implicit dependency of the binding that is changing, but I can't see how to pinpoint it. 我认为绑定的隐含依赖性正在发生变化,但我看不出如何确定它。

I was able to track down the observable responsible for the updates, through the process of elimination, ie disabling parts of the update callback at a time until I eventually found a mutating call to an observable that caused updates. 我能够通过消除过程追踪负责更新的可观察对象,即一次禁用部分更新回调,直到我最终发现对导致更新的可观察对象的变异调用。 I'd still like to know if there's a smarter/more direct debugging method though :) 我还是想知道是否有更聪明/更直接的调试方法:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM