add setupListeners to the redux store (#70953)

pull/71083/head
Gilles De Mey 2 years ago committed by GitHub
parent 280f259f73
commit 09330890f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      public/app/store/configureStore.ts

@ -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;
}

Loading…
Cancel
Save