crystal88/jquery.observable — Issue #3: implement `.toJSON` to support `JSON.stringify`
Author: Raynos
Created: 2011-10-29 21:11:28+00:00
State: open

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);