我已经使用 redux-persist 将数据持久化到 redux 存储。我现在在商店中添加了一些新标志,但是当应用程序从商店更新时,它不会获得新标志,因为它具有旧的本地存储,并且本地存储在更新应用程序时不会清除。这会导致应用程序崩溃,直到我删除它后重新安装该应用程序。
'use strict';
/* React Native */
import { AsyncStorage } from 'react-native';
/* Officetrax */
import { createStore, applyMiddleware } from 'redux';
import app from './reducers';
/* Thunk */
import thunk from 'redux-thunk';
/* Redux Storage */
import excludeSaveActionConstants from './constants/excludeSaveActionConstants';
/* Remote Redux Dev Tools */
import { composeWithDevTools } from 'remote-redux-devtools';
/* Redux Offline */
import { offline } from '@redux-offline/redux-offline';
import offlineConfig from '@redux-offline/redux-offline/lib/defaults';
/* Redux Logger */
import { createLogger } from 'redux-logger';
export default function configureStore() {
// Create redux logger
const logger = createLogger({
//logger: remoteConsole,
logErrors: true,
});
let persistOptions = { ...offlineConfig, whitelist: excludeSaveActionConstants };
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || composeWithDevTools;
// Create the store with middleware applied
let store = createStore(app, composeEnhancers(
applyMiddleware(thunk),
offline(persistOptions)
));
return store;
}
森栏
相关分类