Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tracking array adds and removes is not quite as simple as it first appears...
// Initialise array with some data and track changes
var trackedArray = ko.observableArray([1,2,3]).extend({trackArrayChanges: true});
trackedArray.getChanges();
// -> { } No changes yet
trackedArray.push(4);
trackedArray.pop();
trackedArray.getChanges();
// -> { } Changes have negated each other
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment