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

Allow all deepmerge.Options to be set #258

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ryleyb
Copy link

@ryleyb ryleyb commented Sep 28, 2022

This is just a proof of concept to cover issues with custom object types being converted to plain objects. See
https://www.npmjs.com/package/deepmerge#ismergeableobject for how they describe the issue.

Using this fixes #216 (see example in README.md).

I have never used TS before, so I'm sure I've done some things wrong, I just wanted to show how it could be fixed.

This is just a proof of concept to cover issues with custom object types
being converted to plain objects. See
https://www.npmjs.com/package/deepmerge#ismergeableobject for how they
describe the issue.
@ryleyb
Copy link
Author

ryleyb commented Sep 28, 2022

To be clear - the point of this (for me) is that in my reducer I want to call methods of my classes to change the state from an instance of my class, to some sort of primitive, and then in restoreState re-inflate that data into my class. Without this change, in reducer the classes have already been crushed down into plain Objects, so I can't do anything with them.

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

Successfully merging this pull request may close these issues.

Deepmerge breaks modules not related to persist
1 participant