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

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

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