A memory storage adapter for redux-persist (v0.4.0, stable) that provides an in-memory store for Redux state, intended as a fallback when other storage mechanisms like localStorage or cookies are unavailable. It is commonly used in testing or for clients with restricted storage access. Deliberately limited to ephemeral storage; not for production persistence. Lightweight, zero dependencies, and simple API mirroring the redux-persist storage interface, with optional initial state and logging support.
npm install redux-persist-memory-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates setting up redux-persist with MemoryStorage, including a custom reducer, persist config, and dispatching an action.
Use this only as a fallback. For production persistence, use localForage, redux-persist-cookie-storage, or AsyncStorage (React Native).
If cross-tab synchronization is needed, consider a storage that uses localStorage or IndexedDB with a broadcast channel.
Use the modern persistReducer/persistStore approach as shown in the quickstart. See redux-persist migration guide.
Ensure you pre-populate the MemoryStorage with the desired keys before passing to redux-persist, or initialize store with the same initial state.
const storage = new MemoryStorage(); persistStore(store, { storage });Use 'new MemoryStorage()' instead.
Run 'npm install redux-persist-memory-storage' and use the correct import: import MemoryStorage from 'redux-persist-memory-storage'
No dependency data recorded yet.