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

Copy over new property from initialState to state of localStorage #403

Closed
katat opened this issue Aug 8, 2018 · 0 comments · Fixed by #406
Closed

Copy over new property from initialState to state of localStorage #403

katat opened this issue Aug 8, 2018 · 0 comments · Fixed by #406
Assignees
Labels
bug Something isn't working
Projects
Milestone

Comments

@katat
Copy link
Contributor

katat commented Aug 8, 2018

Instead of adding a default to a property in the selector every time when there is a new property added in the state, I am thinking, it might be better to add a check in the loadState function of localStorage.js.

In the check, it compares the first level properties between the initial state and the one localStorage. If there is a property of initial state that doesn't exist the localStorage, then copy the new property from initial state to the state loaded from localStorage. Basically, we use the initialState as the baseline for data structure of the state and let the subscriber of the localStorage to follow this data structure in order to avoid compatibility issues.

@katat katat added the bug Something isn't working label Aug 8, 2018
@katat katat added this to the 0.3.0 milestone Aug 8, 2018
@katat katat self-assigned this Aug 8, 2018
@katat katat added this to To do in Hubii Core via automation Aug 8, 2018
@katat katat closed this as completed in #406 Aug 9, 2018
Hubii Core automation moved this from To do to Done Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Hubii Core
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant