import {configureStore} from "@reduxjs/toolkit";
import {useDispatch} from "react-redux";
import authReducer from '../features/authSlice';
import uiReducer from '../features/uiSlice';

export const store = configureStore({
    reducer: {
        auth: authReducer,
        ui: uiReducer
    }
});

export type RootState = ReturnType<typeof store.getState>;
type AppDispatch = typeof store.dispatch;
export const useAppDispatch = () => useDispatch<AppDispatch>();