Open pisangGoreng opened 5 years ago
I finally can use redux persist with redux saga. This is my last code
import { applyMiddleware, compose } from 'redux'
import createSagaMiddleware from 'redux-saga'
import Reactotron from "reactotron-react-native";
import { persistStore, persistReducer } from 'redux-persist';
import storage from 'redux-persist/lib/storage';
const persistConfig = {
key: 'root',
storage,
}
// creates the store
export default (rootReducer, rootSaga) => {
/* ------------- Redux Configuration ------------- */
const middleware = []
const enhancers = []
/* ------------- Saga Middleware ------------- */
const sagaMiddleware = createSagaMiddleware()
middleware.push(sagaMiddleware)
/* ------------- Assemble Middleware ------------- */
enhancers.push(applyMiddleware(...middleware))
const persistedReducer = persistReducer(persistConfig, rootReducer)
const store = Reactotron.createStore(persistedReducer, compose(...enhancers));
const persistor = persistStore(store)
// kick off root saga
sagaMiddleware.run(rootSaga)
return { store, persistor };
}
I'm seeing this issue right now but with rn-thunk and no real changes to my redux-persist setup
hi guys, same problem. any other option than redux-sega ? does it going to be solved ?
same issue in RN
Hi Everyone,
Right now I'm trying to integrate redux persist to my redux-saga in react native. I'm already trying some code in CreateStore. My app can run, but the reducer always reset after reloading the app.
This is my code
Does anyone have a clue for solving this issue or I'm wrong to implement Redux persist?? I want the reducer to keep the previous data before reloading the app.
Thanks, Everyone