rtk-persist
v1.0.1
Published
## Commands
Downloads
4
Readme
RTK-persist User Guide
Commands
yarn add rtk-persist
or
npm install --save rtk-persist
Configuration
Replace createSlice
and configureStore
with persistSlice
and configurePersistedStore
.
// slice.ts
const slice = persistSlice(...sliceOptions);
// store.ts
const storage = localStorage; // or AsyncStorage on RN
const store = configurePersistedStore(...storeOptions, storage);