import appReducers from "@/models/appSlice"; import grlStatsReducers from "@/models/grlStatsSlice"; import grlEventsReducers from "@/models/grlEventsSlice"; import { authApi } from "@/models/authAPI"; import profilingQuestionsReducers from "@/models/profilingQuestionsSlice"; import cashoutMethodReducers from "@/models/cashoutMethodsSlice"; import type { Action, ThunkAction } from "@reduxjs/toolkit"; import { configureStore } from "@reduxjs/toolkit"; import { cashoutRequests } from "@/models/cashoutRequests"; export const store = configureStore({ reducer: { app: appReducers, // auth: authReducers, [authApi.reducerPath]: authApi.reducer, stats: grlStatsReducers, events: grlEventsReducers, profilingQuestions: profilingQuestionsReducers, cashoutMethods: cashoutMethodReducers, cashoutRequests: cashoutRequests.reducer, }, middleware: (getDefault) => getDefault().concat(authApi.middleware).concat(cashoutRequests.middleware), }); // Infer the type of `store` export type AppStore = typeof store; // Infer the `AppDispatch` type from the store itself export type AppDispatch = typeof store.dispatch; // Same for the `RootState` type export type RootState = ReturnType; // Define a reusable type describing thunk functions export type AppThunk = ThunkAction< ThunkReturnType, RootState, unknown, Action >;