ko.observable.fn.beforeAndAfterSubscribe = function (callback, target) {
var _oldValue;
this.subscribe(function (oldValue) {
_oldValue = oldValue;
}, null, 'beforeChange');
this.subscribe(function (newValue) {
callback.call(target, _oldValue, newValue);
});
};
a28ub2JzZXJ2YWJsZS5mbi5iZWZvcmVBbmRBZnRlclN1YnNjcmliZSA9IGZ1bmN0aW9uIChjYWxsYmFjaywgdGFyZ2V0KSB7CiAgICB2YXIgX29sZFZhbHVlOwogICAgdGhpcy5zdWJzY3JpYmUoZnVuY3Rpb24gKG9sZFZhbHVlKSB7CiAgICAgICAgX29sZFZhbHVlID0gb2xkVmFsdWU7CiAgICB9LCBudWxsLCAnYmVmb3JlQ2hhbmdlJyk7CgogICAgdGhpcy5zdWJzY3JpYmUoZnVuY3Rpb24gKG5ld1ZhbHVlKSB7CiAgICAgICAgY2FsbGJhY2suY2FsbCh0YXJnZXQsIF9vbGRWYWx1ZSwgbmV3VmFsdWUpOwogICAgfSk7Cn07