-
Notifications
You must be signed in to change notification settings - Fork 123
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
usage with redux-persist: persist only some models #653
Comments
@Leooo there you go, here is what you can do using my package redux-deep-persist import { getPersistConfig } from 'redux-deep-persist';
const config = getPersistConfig({
key: 'root',
storage: LocalStorage, // whatever storage you use
blacklist: [
'a1.b1.c1',
'a2.b2.c2',
'a3',
'a4.b4.c4.no.matter.how.deep.you.go'
],
rootReducer, // your root reducer must be also passed here
... // any other props from original redux-persist config, omitting the stateReconciler
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, this addon works great with redux-persist, only I can't manage to persist only a few models - more exactly, I kind of have done it, but I can't manage to populate again seed data on models I haven't persisted when reloading the page.
There are similar issues opened in redux-persist, but it feels like there should be one specific to redux-orm too.
inspired by rt2zz/redux-persist#134 (comment), this works:
Now that's this bit (orm reducer) that doesn't work for me: inspired by #228 (comment), I tried to add another case where the
state
is not empty but the model creation (Person.seedDatabase()) is not persisted unfortunately. If I remove hasInitializedDB, now it's been created three times. Surely there must be a better way?Many thanks to anyone who has a working solution for redux-orm persistence to share (I also looked at https://github.com/rt2zz/redux-persist#nested-persists without success)
The text was updated successfully, but these errors were encountered: