I'm trying to implement an auto-save feature in a Knockout.js app.
Is there a way to assign a callback for whenever a ViewModel changes?
Take a look at Ryan Niemeyer's smart, dirty flag at http://www.knockmeout.net/2011/05/creating-smart-dirty-flag-in-knockoutjs.html
It is straightforward to create a dependantObservable that depends on everything in your ViewModel - I assume someone will post an answer better than this one that contains code showing it.
(I would prefer if there was a built in "any change" callback, but as far as I can tell there is not.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With