You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: