-
Notifications
You must be signed in to change notification settings - Fork 517
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] Contents of a database in memory? #117
Comments
Hey @brsunter! Thanks for the question. This has actually come up before (and should eventually make it into the readme). I've discussed a solution in #110. Can you check it out and see if it answers your question? |
Hey @Ben-G thanks for the response. I had a look at the thread and It looked like most of the discussion was about ways to keep the ReSwift state in sync with the DB state. However, my concern is having the entire contents of the database in memory when I only need certain parts of it at a given time. I was wondering if there were any best practices around having a database hold information that is not "mirrored" in the app state. I was thinking something along the lines of sending an action that loads subsets of information into the app state, but this breaks the idea that the app state is the single source of truth. |
Hi @brsunter, I'm reading all the open issues and came across this one. I think that @Ben-G's comments and the discussion on #110 do address this issue.
I think that same idea is what's captured on #110:
That would just mean that you'd query the database in the same manner that you'd query a webservice: perhaps in an ActionCreator, or in middleware (a la redux-saga), or in an extended store (a la redux-loop). Issue #64 has a great summary of options and some links to possible implementation ideas.
Personal opinion only, but I have been viewing app state as relating primarily to the state required to set up and manage the UI and user interaction. I do not view a database as part of the app state any more than I view a remote web service as part of the app state: they both contain information that my app may optionally use in its UI. Hope this helps! Thanks, |
Hey Ian, |
No description provided.
The text was updated successfully, but these errors were encountered: