add store and base api

This commit is contained in:
2023-08-05 14:58:27 +02:00
parent 8d75b18f61
commit 6988feae78
7 changed files with 161 additions and 4 deletions

13
src/services/store.ts Normal file
View File

@@ -0,0 +1,13 @@
import { configureStore } from '@reduxjs/toolkit'
import { api } from '@/services/auth'
export const store = configureStore({
reducer: {
[api.reducerPath]: api.reducer,
},
middleware: getDefaultMiddleware => getDefaultMiddleware().concat(api.middleware),
})
export type AppDispatch = typeof store.dispatch
export type RootState = ReturnType<typeof store.getState>