Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serializing circular objects and toJSON #77

Open
doublemarked opened this issue Mar 13, 2019 · 2 comments
Open

Serializing circular objects and toJSON #77

doublemarked opened this issue Mar 13, 2019 · 2 comments

Comments

@doublemarked
Copy link

doublemarked commented Mar 13, 2019

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?

@doublemarked
Copy link
Author

Hey @bluepnume any thoughts on this issue? Maybe you can advise on a fix? I can probably find time to work on a PR

@ddenev
Copy link

ddenev commented Jan 7, 2020

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants