mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-25 15:40:06 +03:00
fix(rtk-query): demo build failing caused by a typing error
This commit is contained in:
parent
8a49ed924e
commit
6c3db1eae6
|
@ -1,4 +1,9 @@
|
|||
import { configureStore, Middleware } from '@reduxjs/toolkit';
|
||||
import {
|
||||
configureStore,
|
||||
Middleware,
|
||||
combineReducers,
|
||||
EnhancedStore,
|
||||
} from '@reduxjs/toolkit';
|
||||
import { pokemonApi } from './services/pokemon';
|
||||
import { postsApi } from 'services/posts';
|
||||
import DevTools from './features/DevTools/DevTools';
|
||||
|
@ -6,17 +11,19 @@ import { isExtensionEnabled } from 'features/DevTools/helpers';
|
|||
|
||||
const devTools = isExtensionEnabled();
|
||||
|
||||
export const store = configureStore({
|
||||
reducer: {
|
||||
[pokemonApi.reducerPath]: pokemonApi.reducer,
|
||||
[postsApi.reducerPath]: postsApi.reducer,
|
||||
},
|
||||
const reducer = combineReducers({
|
||||
[pokemonApi.reducerPath]: pokemonApi.reducer,
|
||||
[postsApi.reducerPath]: postsApi.reducer,
|
||||
});
|
||||
|
||||
export const store: EnhancedStore<ReturnType<typeof reducer>> = configureStore({
|
||||
reducer,
|
||||
devTools,
|
||||
// adding the api middleware enables caching, invalidation, polling and other features of `rtk-query`
|
||||
middleware: (getDefaultMiddleware) =>
|
||||
getDefaultMiddleware().concat([
|
||||
pokemonApi.middleware,
|
||||
postsApi.middleware,
|
||||
] as Middleware[]),
|
||||
enhancers: devTools ? [] : [DevTools.instrument()],
|
||||
]) as Middleware[],
|
||||
enhancers: (devTools ? [] : [DevTools.instrument()]) as any,
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user