Force a computed property function to run

后端 未结 5 1599
鱼传尺愫
鱼传尺愫 2021-01-30 15:29

Given a computed property

vm.checkedValueCount = ko.computed(function(){
  var observables = getCurrentValues();  //an array of ko.observable[]
  return _.filter         


        
5条回答
  •  甜味超标
    2021-01-30 16:29

    suppose getCurrentValues() can return different sets of observables which are modified elsewhere in the code

    I assume getCurrentValues() is a function. If you could make it a computed, your checkedValueCount would just magically start working.

    Can you make getCurrentValues be a computed instead of a function?

提交回复
热议问题