import { configureStore } from '@reduxjs/toolkit';
import api from './backend';
import courses from './slices/courses';
import course from './slices/course';
import user from './slices/user';
export const store = configureStore({
reducer: {
user,
courses,
course,
[api.reducerPath]: api.reducer,
},
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware().concat(api.middleware),
devTools: process.env.NODE_ENV !== 'production',
});
export default store;
export type RootState = ReturnType<typeof store.getState>;