redux-persist#PersistConfig TypeScript Examples
The following examples show how to use
redux-persist#PersistConfig.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.ts From jellyfin-audio-player with MIT License | 6 votes |
persistConfig: PersistConfig<Omit<AppState, '_persist'>> = {
key: 'root',
storage: AsyncStorage,
version: 2,
stateReconciler: autoMergeLevel2,
migrate: createMigrate({
// @ts-expect-error migrations are poorly typed
1: (state: AppState & PersistState) => {
return {
...state,
settings: state.settings,
downloads: downloadsInitialState,
music: musicInitialState
};
},
// @ts-expect-error migrations are poorly typed
2: (state: AppState) => {
return {
...state,
downloads: {
...state.downloads,
queued: []
}
};
}
})
}
Example #2
Source File: store.ts From shadowsocks-electron with GNU General Public License v3.0 | 5 votes |
persistConfig: PersistConfig<RootState> = {
key: "root",
storage: createElectronStorage({
electronStore: new Store()
}),
stateReconciler: autoMergeLevel2,
blacklist: ["status"]
}
Example #3
Source File: storage.tsx From reactant with MIT License | 5 votes |
protected persistConfig: Record<string, PersistConfig<any>> = {};