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

Question: Save Store/Load Store #1435

Open
ElonVolo opened this issue Feb 6, 2024 · 1 comment
Open

Question: Save Store/Load Store #1435

ElonVolo opened this issue Feb 6, 2024 · 1 comment

Comments

@ElonVolo
Copy link

ElonVolo commented Feb 6, 2024

Here's my scenario:

I am working on an iPhone app in create native, using the ignite framework and mobx-state-tree. The best way for me to test the design is by doing some actual value work on my device in the app, and that's work that I don't want to lose to some freak accident (bundle identifer getting accidentally renamed, whatever).

Here's my question: does Reactotron provide some out-of-the-box way to for me to click a button, open up a save file dialog, save the entire mobx-state-tree store from the phone to a file of my choosing, and then have a way to load that saved mst-store file back in by clicking another button that opens up an "Open File" dialog?

I'm sure there's some roundabout ways involving saving snapshots to clipboards and copy pasting the data into some hardcoded/ifdef'ed files, but I'm wondering if there's some non-obvious or non-documented way of doing what I just described.

And if this simple feature doesn't exist, would the project accept a PR that adds it?

@morganick
Copy link
Contributor

@ElonVolo Out of the box we support taking snapshots of the current store. Here's a screenshot of where this is inside of Reactotron:

Screenshot 2024-03-26 at 3 39 35 PM

Even though we have a way for you to copy out the current state of the store as JSON. I don't see a way to replace the store with JSON of your own inside of Reactotron.

@markrickert or @joshuayoes may know something that I don't.

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

No branches or pull requests

2 participants