我尝试通过刷新检查更新状态。(cmd + R-> ios)
const persistConfig = {
key: 'root',
storage,
whitelist: ['user'],
};
const persistedReducer = persistCombineReducers (persistConfig, reducers);
const middlewares = [promiseMiddleware (), thunk];
// eslint-disable-next-line
if (__DEV__) {
middlewares.push (createLogger ());
}
export default () => {
const store = createStore (
persistedReducer,
undefined,
compose (applyMiddleware (...middlewares))
);
const persistor = persistStore (store);
return {store, persistor};
};
const persistConfig = {
key: 'root',
storage,
whitelist: ['user', 'home'],
};
const persistedReducer = persistCombineReducers (persistConfig, reducers);
const middlewares = [promiseMiddleware (), thunk];
// eslint-disable-next-line
if (__DEV__) {
middlewares.push (createLogger ());
}
export default () => {
const store = createStore (
persistedReducer,
undefined,
compose (applyMiddleware (...middlewares))
);
const persistor = persistStore (store);
return {store, persistor};
};