Open pbomb opened 7 years ago
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?
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
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.
In order to support serialization, provide a
toJS
(andtoJSON
alias) function to convert the ImmutableModel into its modelType form.