-
Notifications
You must be signed in to change notification settings - Fork 56
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
Support for Maps #60
Comments
Map support is not planned. When you JSON.stringify a map object you get a simple object, and something similar happens when you add it to a freezer store, all the functions get stripped off. |
I thought as much. What about passing a possible second argument when the freezer is created from an json object? And that argument is the schema of field types to parse it to? |
Trying to parse class instances inside freezer would have a really big downside: those object could be mutated without triggering events. For example, the Map class has all the getter and setter methods that modify its internal state. Even when you freeze it you are able to use that methods to update it:
This way we lose the point of using freezer. |
Thank you for the detailed explanation. |
Can support be added for ES2015 Map data structures? Converting it to and from json does not correctly convert Maps.
The text was updated successfully, but these errors were encountered: