Redux Persist Migrate
Migrate redux state between versions with redux-persist.
Usage
// VERSION_REDUCER_KEY is the key of the reducer you want to store the state version in.// You _must_ create this reducer, redux-persist-migrate will not create it for you.// In this example after migrations run, `state.app.version` will equal `2`const VERSION_REDUCER_KEY = 'app' // This is a list of changes to make to the state being rehydrated.// The keys must be integers, and migrations will be performed in ascending key order.// Note: blacklisted reducers will not be present in this state.const manifest = 1: ...state staleReducer: undefined 2: ...state app: ...stateapp staleKey: undefined const migration = const enhancer = const reducer = const store =
In the above example migration = createMigration(manifest, VERSION_REDUCER_KEY)
is equivalent to the more generalized syntax:
// alternatively with version selector & setterconst migration =