import { configureStore } from '@reduxjs/toolkit';
import counterReducer from './counter/counterSlice';
import windowSizeReducer from './windowSize/windowSizeSlice';
import mousePositionReducer from './mousePosition/mousePositionSlice';

// Configure the store
const store = configureStore({
  reducer: {
    counter: counterReducer, // Add the counter reducer to the store
    windowSize: windowSizeReducer, // Add windowSize reducer
    mousePosition: mousePositionReducer, // Add mousePosition reducer
  },
});

// Define the RootState type (used for useSelector)
export type RootState = ReturnType<typeof store.getState>;

// Define the AppDispatch type (used for useDispatch)
export type AppDispatch = typeof store.dispatch;

// Export the store
export default store;
