mirror of
https://git.sr.ht/~ashkeel/strimertul
synced 2024-09-20 02:00:49 +00:00
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;
|