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

feat: add import of store state json to devtools middleware #373

Merged
merged 1 commit into from
Apr 27, 2021

Conversation

jose-vale
Copy link
Contributor

Currently it is possible to export the state of the store in redux devtools, but it is not possible to import, this PR adds this functionality.

devtools.mov

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 8807cae:

Sandbox Source
React Configuration
React Typescript Configuration

@jose-vale jose-vale changed the title feat: allow import of json to devtools middleware feat: add import of store json to devtools middleware Apr 25, 2021
@jose-vale jose-vale changed the title feat: add import of store json to devtools middleware feat: add import of store state json to devtools middleware Apr 25, 2021
@dai-shi
Copy link
Member

dai-shi commented Apr 26, 2021

Wow, this looks nice. Where can I learn about IMPORT_STATE?
https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/API/Methods.md doesn't seem to have enough spec.

I'm pretty sure this won't break anything, but could anyone review the code?
Also, we would like to apply the same technique to jotai and valtio. (any volunteers? maybe I should create an issue in each repo.)

@jose-vale
Copy link
Contributor Author

jose-vale commented Apr 26, 2021

There doesn't seem to be any information in the docs that I could find. When looking into this, I was able to find a bit of information from the extension code and also from this comment.

@dai-shi
Copy link
Member

dai-shi commented Apr 26, 2021

@jose-vale Thanks for pointers.

Could anyone else test the codesandbox build and give 👍 ?
https://ci.codesandbox.io/status/pmndrs/zustand/pr/373/builds/123549

Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me.

@dai-shi
Copy link
Member

dai-shi commented Apr 27, 2021

Okay, let's merge this and see how it goes.

@jose-vale Thanks for your contribution. I like the video with the bear, btw.

@dai-shi dai-shi merged commit 6bc11ed into pmndrs:master Apr 27, 2021
@dai-shi
Copy link
Member

dai-shi commented Apr 27, 2021

@jose-vale jose-vale deleted the add-import-to-devtools branch April 27, 2021 05:58
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.

2 participants