jquery.observable
jquery.observable copied to clipboard
implement `.toJSON` to support `JSON.stringify`
If you implement a .toJSON
method on your observable object then it will work with JSON.stringify.
In case you don't know, JSON.stringify
will call a .toJSON
method if it exists on the object you pass in and then stringify the return value.
Example:
var o = $.observable(someData);
// your toJSON method called $.observable.remove(o) for me.
JSON.stringify(o);
Thanks, I will implement that for sure