Skip to content

Instantly share code, notes, and snippets.

@beyond-code-github
Last active August 29, 2015 13:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save beyond-code-github/8736429 to your computer and use it in GitHub Desktop.
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