-
Notifications
You must be signed in to change notification settings - Fork 1k
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
debug_session with immutable.js #53
Comments
The extension shouldn't send back anything, it just gets changes from the lifted store, and dispatch actions to the lifted store in order to change anything. Default serialization introduced in #35, can be disabled in settings, but that problem you described comes not from the extension's serializations, but from The solution would be to remove |
I got it working by passing down the following deserialisation function to persistState [Edited]
for now I am running the extension locally but maybe we could do something like this:
where devToolDeserialiseFunc have to be in the window otherwise persist state would just use identity like it does now
|
I think we could pass the deserialisation function to the extension like so: window.devToolsExtension({ devToolDeserialiseFunc }) This function can be used not only for the Another option would be to have this function inside the extension (avoiding boilerplate) and pass a flag which will require it as window.devToolsExtension({ isImmutableJS }) Or maybe we can even identify if the state contains ImmutableJS directly? |
If you want to package the function with the extension you'd have to package immutable too, I am not sure it's a good option. I'd be happy to submit a PR including:
Also it would be great to output a warning refering to the readme if we try to serialize immutable data. For the recored redux persist solves this be triggering an event when deserializing data. This event can be caught by the reducers to regenerate data |
Agree, we don't want to package and inject Immutable.js in every page. Growing the injected script size would lead to a latency in loading and the store will be created before the Using the extension as window.devToolsExtension({ deserialize: state => Immutable.fromJS(state) }) would be pretty neat. The PR would be welcome. Also the parameter should be specified in the API section (we have |
Implemented in #65. Should work in Please see the API section and give it a try. |
It seems that after the immutable.js fix 35 every thing get serialized to plain JS. but now when using ?debug_session=ds, it doesn't deserialized back to immutable.js and i'm getting
.get is not a function
.Is there a way to tell the extension to deserialize back to immutable.js, and still keep the state in the panes plain JS?
The text was updated successfully, but these errors were encountered: