Skip to content

Instantly share code, notes, and snippets.

@cmaas
Created February 10, 2015 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmaas/a95b1b573168ae24a2fb to your computer and use it in GitHub Desktop.
Save cmaas/a95b1b573168ae24a2fb to your computer and use it in GitHub Desktop.
Knockout: Dirty Flag / Dirty Tracking
// dirty tracking
// original: https://github.com/tekpub/knockout-cart/blob/master/src/cart.js
ko.computed(function(){
// do things like:
// localStorage.setItem("tekpubCart",ko.toJSON(self.items));
}).extend({throttle : 1});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment