Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 430 Bytes

README.md

File metadata and controls

24 lines (16 loc) · 430 Bytes

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);