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

Provide toJS and toJSON functions #15

Open
pbomb opened this issue Dec 14, 2016 · 3 comments
Open

Provide toJS and toJSON functions #15

pbomb opened this issue Dec 14, 2016 · 3 comments
Assignees

Comments

@pbomb
Copy link
Owner

pbomb commented Dec 14, 2016

In order to support serialization, provide a toJS (and toJSON alias) function to convert the ImmutableModel into its modelType form.

@pbomb pbomb self-assigned this Dec 15, 2016
@pbomb pbomb closed this as completed in b220738 Dec 15, 2016
@pbomb pbomb removed the in progress label Dec 15, 2016
object88 pushed a commit to object88/flow-immutable-models that referenced this issue Dec 28, 2016
object88 pushed a commit to object88/flow-immutable-models that referenced this issue Dec 28, 2016
@Fi3
Copy link

Fi3 commented Apr 10, 2017

Why didn't you add toJSON? I think that toJSON would be a lot faster than toJS to encode the model as a string. Is that right?

@pbomb
Copy link
Owner Author

pbomb commented Apr 10, 2017

Yeah, you're right. I'll put together a pull request to add toJSON as a shallow operation which will work better when using JSON.stringify

@pbomb pbomb reopened this Apr 10, 2017
@pbomb
Copy link
Owner Author

pbomb commented Apr 11, 2017

I'm going to hold off on this until Immutable-JS 4.0.0 is released. The current version doesn't have correct flow types for the toJSON function.

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

No branches or pull requests

2 participants