add setupListeners to the redux store (#70953)

This commit is contained in:
Gilles De Mey
2023-07-05 12:22:48 +02:00
committed by GitHub
parent 280f259f73
commit 09330890f3

View File

@@ -1,4 +1,5 @@
import { configureStore as reduxConfigureStore, createListenerMiddleware } from '@reduxjs/toolkit';
import { setupListeners } from '@reduxjs/toolkit/query';
import { browseDashboardsAPI } from 'app/features/browse-dashboards/api/browseDashboardsAPI';
import { publicDashboardApi } from 'app/features/dashboard/api/publicDashboardApi';
@@ -36,6 +37,9 @@ export function configureStore(initialState?: Partial<StoreState>) {
},
});
// this enables "refetchOnFocus" and "refetchOnReconnect" for RTK Query
setupListeners(store.dispatch);
setStore(store);
return store;
}