18 lines
635 B
JavaScript
18 lines
635 B
JavaScript
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
import { applyMiddleware, createStore } from 'redux';
|
|
import { persistStore, persistReducer } from 'redux-persist';
|
|
import thunk from 'redux-thunk';
|
|
|
|
import rootReducer from './reducers';
|
|
|
|
const persistConfig = {
|
|
key: 'root',
|
|
storage: AsyncStorage,
|
|
blacklist: ['isLoggingIn', 'isFetchingUserData', 'isRegisteringUser', 'isChargingMembership', 'loginError'],
|
|
};
|
|
|
|
const persistedReducer = persistReducer(persistConfig, rootReducer);
|
|
|
|
export const store = createStore(persistedReducer, applyMiddleware(...[thunk]));
|
|
export const persistor = persistStore(store);
|