A minimal test app for @mdemichele/redux-persist, a custom implementation of redux-persist built from scratch.
This app exists to verify that @mdemichele/redux-persist works correctly end-to-end. It renders a simple counter backed by a Redux store. When you increment the counter and refresh the page, the value should be restored automatically from localStorage — confirming that state persistence and rehydration are functioning as expected.
The counter slice is wrapped with persistReducer using localStorage as the storage engine and "root" as the persistence key. On app startup, PersistGate blocks rendering until the persisted state has been rehydrated into the store. This mirrors the standard redux-persist integration pattern.
git clone https://github.com/mdemichele/redux-persist-test-app.git
cd redux-persist-test-app
npm install
npm run devThe app will be available at http://localhost:5173.
- Open the app in your browser.
- Click + to increment the counter a few times.
- Refresh the page.
- The counter should display the same value — restored from
localStorageunder the key"root".
You can inspect the persisted value directly in your browser's DevTools under Application → Local Storage.
| Command | Description |
|---|---|
npm run dev |
Start the development server |
npm run build |
Type-check and build for production |
npm run preview |
Preview the production build locally |
- React 18
- Redux Toolkit
- react-redux
- @mdemichele/redux-persist
- Vite + TypeScript