mirror of https://git.sr.ht/~ashkeel/strimertul
24 lines
610 B
TypeScript
24 lines
610 B
TypeScript
import { configureStore, getDefaultMiddleware } from '@reduxjs/toolkit';
|
|
import { useDispatch } from 'react-redux';
|
|
import thunkMiddleware from 'redux-thunk';
|
|
import apiReducer from './api/reducer';
|
|
|
|
const store = configureStore({
|
|
reducer: {
|
|
api: apiReducer.reducer,
|
|
},
|
|
middleware: [
|
|
...getDefaultMiddleware({
|
|
serializableCheck: false,
|
|
}),
|
|
thunkMiddleware,
|
|
],
|
|
devTools: true,
|
|
});
|
|
|
|
export type RootState = ReturnType<typeof store.getState>;
|
|
export type AppDispatch = typeof store.dispatch;
|
|
export const useThunkDispatch = () => useDispatch<AppDispatch>();
|
|
|
|
export default store;
|