This commit is contained in:
2024-03-28 00:06:00 +03:00
parent 717596f55c
commit 425b109126
7 changed files with 99 additions and 9 deletions

View File

@ -0,0 +1,18 @@
import { configureStore } from '@reduxjs/toolkit'
import { setupListeners } from '@reduxjs/toolkit/query'
import { AuthApi } from '../slice/AuthApi'
export const store = configureStore({
reducer: {
// Add the generated reducer as a specific top-level slice
[AuthApi.reducerPath]: AuthApi.reducer,
},
// Adding the api middleware enables caching, invalidation, polling,
// and other useful features of `rtk-query`.
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware().concat(AuthApi.middleware),
})
// optional, but required for refetchOnFocus/refetchOnReconnect behaviors
// see `setupListeners` docs - takes an optional callback as the 2nd arg for customization
setupListeners(store.dispatch)