ENEI2019-Public/App/app/store/store.js

25 lines
558 B
JavaScript
Raw Normal View History

2019-02-22 23:38:34 +00:00
import { createStore, applyMiddleware , compose} from 'redux';
2019-01-31 00:46:49 +00:00
import thunk from 'redux-thunk';
import reducers from './reducers/index'; //Import the reducer
2019-02-22 23:38:34 +00:00
import {persistStore, persistReducer} from 'redux-persist'
import {AsyncStorage} from 'react-native'
const persistConfig={
key:'root' ,
storage: AsyncStorage,
}
const persistedReduzer= persistReducer(persistConfig, reducers);
2019-01-31 00:46:49 +00:00
// Connect our store to the reducers
2019-02-22 23:38:34 +00:00
export const store = createStore(persistedReduzer, applyMiddleware(thunk));
export const persistor=persistStore(store);