How to force a view refresh without having it trigger automatically from an observable?

前端 未结 3 981
鱼传尺愫
鱼传尺愫 2020-11-29 18:12

Note: this is mostly for debugging and understanding KnockoutJS.

Is there a way to explicitly request Knockout to refresh the view from (already bou

3条回答
  •  -上瘾入骨i
    2020-11-29 18:23

    You can't call something on the entire viewModel, but on an individual observable you can call myObservable.valueHasMutated() to notify subscribers that they should re-evaluate. This is generally not necessary in KO, as you mentioned.

提交回复
热议问题