JSFiddle - React, Tailwind, and code Playground
HTML
<p>I want this to update to 35 <input data-bind='value: comp1' /></p>
<p>I want this to update to 22 <input data-bind='value: comp2' /></p>
JavaScript
var ViewModel = function() {
var self = this;
self.obs1 = ko.observable(10);
self.obs2 = ko.observable(2);
//I want this computed to behave normally
self.comp1 = ko.computed(function() {
return self.obs1() + self.obs2();
}, this);
//I want this computed to trigger on obs1 update but ignore updates to obs2
self.comp2 = ko.computed(function() {
return self.obs1() + self.obs2();
}, this);
setTimeout(function() {
self.obs1(20);
self.obs2(15);
}, 1000);
};
ko.applyBindings(new ViewModel());