Created
March 27, 2024 13:41
src/store/store.ts file for RTK Query Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { configureStore } from '@reduxjs/toolkit' | |
import { applicationApi } from './service' | |
import { setupListeners } from '@reduxjs/toolkit/query' | |
export const store = configureStore({ | |
reducer: { | |
[applicationApi.reducerPath]: applicationApi.reducer, | |
}, | |
middleware: (getDefaultMiddleware) => | |
getDefaultMiddleware().concat(applicationApi.middleware), | |
}) | |
// optional, but required for refetchOnFocus/refetchOnReconnect behaviors | |
setupListeners(store.dispatch) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment