knockout.ChangeTracker.js

Rating: No reviews yet
Downloads: 139
Released: Feb 11, 2012
Updated: Feb 11, 2012 by johnpapa
Dev status: Stable Help Icon

Recommended Download

Source Code knockout.changeTracker.js
source code, 2K, uploaded Feb 11, 2012 - 139 downloads

Release Notes

Change tracking object for tracking state of a JavaScript View Model when using KnockoutJS (http://www.knockout.com)


To Setup change tracking, add this tracker property to your view model:

viewModel.tracker = new ChangeTracker(viewModel);

Hook these into your view to determine when changes occur:

viewModel.tracker().somethingHasChanged();

Hook this into your view model when you want to reset state in functions (ex: load, save):

viewModel.tracker().markCurrentStateAsClean;

Optionally, you can pass your own hashFunction for state tracking, too.

Reviews for this release

No reviews yet for this release.