post-robot
post-robot copied to clipboard
Serializing circular objects and toJSON
I'm using post-robot
via zoid
, passing an object back to my parent via a callback function. This object contains a circular reference deep within it, but I've implemented a toJSON()
method on the class containing the reference in order to support serialization.
This object can be happily serialized with JSON.stringify(), but it breaks when post-robot
serializes it. I believe post-robot
isn't calling my toJSON() method, it's walking the object itself and follows the circular reference to its doom.
Please advise?
Hey @bluepnume any thoughts on this issue? Maybe you can advise on a fix? I can probably find time to work on a PR
+1