{"size": 976, "ext": "js", "max_stars_repo_path": "src/redux/store.js", "max_stars_repo_name": "ahmed-fayyaz-dev/quickeze-rider", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/redux/store.js", "max_issues_repo_name": "ahmed-fayyaz-dev/quickeze-rider", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/redux/store.js", "max_forks_repo_name": "ahmed-fayyaz-dev/quickeze-rider", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 37.5384615385, "max_line_length": 74, "alphanum_fraction": 0.7581967213}
import AsyncStorage from '@react-native-async-storage/async-storage';
import { composeWithDevTools } from '@redux-devtools/extension';
import { createStore, applyMiddleware } from 'redux';
import { persistStore, persistReducer } from 'redux-persist';
import thunk from 'redux-thunk';
import { saveOnLogin, clearOnLogout } from './middleware/otherMiddleWare';
import { ServiceMiddleware } from './middleware/serviceMiddleWare.js';
import rootReducers from './reducer';

const persistConfig = {
    key: 'root',
    storage: AsyncStorage,
    // blacklist: ['quarterReducer', 'fYearReducer'],
    whitelist: ['submitLoginReducer', 'languageReducer'],
};

const persistedReducer = persistReducer(persistConfig, rootReducers);
const middleware = [thunk, ServiceMiddleware, saveOnLogin, clearOnLogout];
const store = createStore(
    persistedReducer,
    composeWithDevTools(applyMiddleware(...middleware)),
);
const persistor = persistStore(store);

export { store, persistor };
