-
Notifications
You must be signed in to change notification settings - Fork 866
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
stateReconciler deep merge example #491
Comments
options:
|
Can you please elaborate how to add reducer because after adding reducer new object with reducer name is created in the state and it have state from the local storage in that reducer and state updation of "intl" object in the above state is not affected by my reducer. |
Isn't there a way we can write our own reconcilers or mention merge levels in configuration. |
import { cloneDeep, isObject, merge, omit } from 'lodash';
stateReconciler: (
inboundState: Record<string, {}>,
originalState: Record<string, {}>,
reducedState: Record<string, {}>,
): Record<string, {}> => {
const newState = cloneDeep(omit(reducedState, ['_persist']));
return isObject(inboundState) ? merge({}, newState, inboundState) : newState;
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have following state
`{ bluerain: {
intl: {
locale: 'en',
rtl: false,
messages: {
en:{},
ur:{},
ch:{},
}
}
}`
I have used redux-persist-transform-filter to ignore "messages" object while storing state in localstorage, initially messages are stored in initial state of redux store but due to shallow merge mesages in my initial store are not merged with that of localstorage state. Any suggestions so that my messages object will not stored in localstorage but I get messages from initial state in my store after autoRehydrate
The text was updated successfully, but these errors were encountered: