Open Bram-Zijp opened 4 months ago
My store is created with or without redux-persist dynamically. It would be nice to disable storage creation errors when a store is initialized without using the redux-persist persistedReducer and/or preferably when persistStore(store) is not called.
persistedReducer
persistStore(store)
Example:
import storage from "redux-persist/lib/storage"; import { persistStore, persistReducer, } from "redux-persist"; const persistedReducer = persistReducer( { key: "root", version: 1, storage, // ignore error option here? }, rootReducer ); export const createStore = ( persistToLocalStorage: boolean = false, ) => { const store = configureStore({ reducer: persistToLocalStorage ? persistedReducer : rootReducer, }); // only error here when persistStore? const persistor = persistToLocalStorage ? persistStore(store) : undefined; return { store, persistor }; };
My store is created with or without redux-persist dynamically. It would be nice to disable storage creation errors when a store is initialized without using the redux-persist
persistedReducer
and/or preferably whenpersistStore(store)
is not called.Example: