import { combineReducers } from "redux";
import { persistReducer } from "redux-persist";
import storage from "redux-persist/lib/storage";

import userReducer from "./user/user.reducer";
import messagingReducer from "./messaging/messaging.reducer";
import emailReducer from "./email/email.reducer";
import modalsReducer from './modals/modals.reducer'
const persistConfig = {
  key: "root",
  storage,
  //whitelist: ["user"]
  blacklist: ["user", "email", "messaging", "modals"]
};

const rootReducer = combineReducers({
  user: userReducer,
  messaging: messagingReducer,
  email: emailReducer,
  modals: modalsReducer
});

export default persistReducer(persistConfig, rootReducer);
