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

Any showcase how to work with Immutables? #380

Open
rybandrei2014 opened this issue Mar 5, 2023 · 2 comments
Open

Any showcase how to work with Immutables? #380

rybandrei2014 opened this issue Mar 5, 2023 · 2 comments
Labels
question Further information is requested

Comments

@rybandrei2014
Copy link

I've been using 4.0.0-rc21, before upgrading to 4.0.0. Everytime I accessed a state I received object of original state type. But after upgrading to 4.0.0. almost all my state retrieval logic is broken due to everything is now wrapped in Immutables. I passed some objects to third party functions that don't expect them to be wrapped in Immutable. Can you please provide some showcase how to work with Immutables? Thanks in advance

@avkonst
Copy link
Owner

avkonst commented Mar 31, 2023

I see. When you pass these objects to 3rd party libraries do they mutate the objects or only read? If they mutate than it is going to throw at runtime. If they only read we can probably make it working if you could share a bit more details.

As a workaround you can remove immutable from a type, but it is probably not what you would like to have?

@avkonst avkonst added the question Further information is requested label Mar 31, 2023
@onhernandes
Copy link

I had this same issue but a workaround was to copy the data when needed, like before sending through fetch I just used const data: Type = { ...state.get() }

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

No branches or pull requests

3 participants