JSFiddle - React, Tailwind, and code Playground
HTML
<input data-bind="value: data">
JavaScript
var enclosedObservable = ko.observable();
this.myObservable = ko.computed({
read: enclosedObservable,
write: function (newValue) {
var oldValue = enclosedObservable.peek();
alert(oldValue);
enclosedObservable(newValue);
}
});
ko.applyBindings({data: myObservable});