Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Skeleton change tracked array extender for knockout.kj
ko.extenders.trackArrayChange = function (target, track) {
if (track) {
target.isDirty = ko.observable(false);
target.added = ko.observableArray([]);
target.removed = ko.observableArray([]);
var addItem = function (item) {
//...
};
var removeItem = function (item) {
//...
};
target.getChanges = function () {
var result = {
added: target.added,
removed: target.removed
};
return result;
};
//....
//....
}
}
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.