Created
May 1, 2020 14:44
-
-
Save AllGistsEqual/5df8ca25ef15bf01f496ea32bb1eb1cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { applyMiddleware, createStore } from 'redux' | |
import { persistStore, persistReducer } from 'redux-persist' | |
import { AsyncStorage } from 'react-native' | |
import rootReducer from './reducers/rootReducer' | |
import middleware from './middleware' | |
const persistConfig = { | |
key: 'root', | |
storage: AsyncStorage, | |
} | |
const persistedReducer = persistReducer(persistConfig, rootReducer) | |
const store = createStore( | |
persistedReducer, | |
applyMiddleware( | |
...middleware, | |
), | |
) | |
export const persistor = persistStore(store) | |
export default store |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment