ilink-world/redux/store.js

21 lines
590 B
JavaScript
Raw Normal View History

2020-04-17 22:03:04 +00:00
import { AsyncStorage } from "react-native";
import { persistReducer, persistStore } from "redux-persist";
import { createStore, applyMiddleware } from "redux";
import thunk from 'redux-thunk';
import rootReducer from "./reducers";
const persistConfig = {
key: 'root',
storage: AsyncStorage,
whitelist: [],
blacklist: []
};
const persistedReducer = persistReducer(persistConfig, rootReducer);
const middlewares = [thunk];
const store = createStore(persistedReducer, applyMiddleware(...middlewares));
let persistor = persistStore(store);
export { store, persistor };