Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Modified version of apply change tracking to observable that properly track arrays
//....
//....
var applyChangeTrackingToObservable = function (observable) {
// Only apply to basic writeable observables
if (observable && !observable.nodeType && !observable.refresh && ko.isObservable(observable)) {
if (observable.isObservableArray) {
observable.extend({ trackArrayChange: true });
}
else {
if (!observable.isDirty) observable.extend({ trackChange: true });
}
}
};
//....
//....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.