rt2zz / redux-persist

persist and rehydrate a redux store
MIT License
12.94k stars 866 forks source link

@alexandrebouttier you should use a middleware and export like this - #1316

Open alexandrebouttier opened 3 years ago

alexandrebouttier commented 3 years ago

@alexandrebouttier you should use a middleware and export like this -

const persistedReducer = persistReducer(persistConfig, rootReducers);

export const store = createStore(persistedReducer, applyMiddleware(thunk));
export const persistor = persistStore(store);

Originally posted by @mayank-budhiraja in https://github.com/rt2zz/redux-persist/issues/1314#issuecomment-866648161