fixes the middleware setup

This commit is contained in:
ajaythapliyal
2023-02-25 09:52:15 +05:30
parent 4bc1a87fcf
commit f90abd8753

View File

@@ -20,12 +20,12 @@ const store = configureStore({
preference: prefSlice.reducer,
conversation: conversationSlice.reducer,
},
middleware: (getDefaultMiddleware) => [
...getDefaultMiddleware(),
prefListenerMiddleware.middleware,
],
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware().concat(prefListenerMiddleware.middleware),
});
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;
export default store;
// TODO : use https://redux-toolkit.js.org/tutorials/typescript#define-typed-hooks everywere instead of direct useDispatch