Hi is there a way to not fire the function when instantiating a ko.computed
example is
i have this ko.computed
ko.computed(function(){ alert(this.Test); } , this);
so basically if i instantiated this computed this will fire the function defined there is there a way not to fire it upon instantiation? and only fire it when dependency change?
You need to set the
deferEvaluation
option:You can also use a knockout
pureComputed
for this. A pure computed only evaluates when there's a dependency.Example: