import AsyncStorage from '@react-native-async-storage/async-storage';
import { combineReducers } from "redux";
import { persistReducer } from "redux-persist";
import appReducer from "./app/app.reducer";
import photosReducer from "./photos/photos.reducer";
import userReducer from "./user/user.reducer";

const persistConfig = {
  key: "root",
  storage: AsyncStorage,
  // whitelist: ["photos"],
  blacklist: ["user", "photos"], // Add reducers you do NOT want to persist
};

const rootReducer = combineReducers({
  user: userReducer,
  app: appReducer,
  photos: photosReducer,
});

export default persistReducer(persistConfig, rootReducer);
