Reputation: 95
Everyone i have been using redux-persist for a while now and is really a great tool, but the problem is that it just persist all my states (reducers), i will like to know is there is a way to choose which states are to be persist. Thanks
Upvotes: 0
Views: 796
Reputation: 1936
In your redux-persist config you can add a whitelist
or blacklist
depending on your need. These take an array of the states you would like to include (whitelist) or ignore (blacklist).
For example:
const persistConfig = {
key: 'root',
blacklist: ['state-not-to-be-persisted']
}
Upvotes: 4