mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-11-24 16:29:45 +01:00
38 lines
929 B
TypeScript
38 lines
929 B
TypeScript
import { Action, ThunkAction, configureStore } from '@reduxjs/toolkit';
|
|
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';
|
|
import {
|
|
FLUSH,
|
|
PAUSE,
|
|
PERSIST,
|
|
PURGE,
|
|
REGISTER,
|
|
REHYDRATE,
|
|
} from 'redux-persist';
|
|
|
|
import rootReducer from 'reducers/rootReducer';
|
|
|
|
const store = configureStore({
|
|
reducer: rootReducer,
|
|
middleware: (getDefaultMiddleware) =>
|
|
getDefaultMiddleware({
|
|
serializableCheck: {
|
|
ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],
|
|
},
|
|
}),
|
|
});
|
|
|
|
export type RootState = ReturnType<typeof store.getState>;
|
|
|
|
export type AppDispatch = typeof store.dispatch;
|
|
|
|
export type AppThunk<ReturnType = void> = ThunkAction<
|
|
ReturnType,
|
|
RootState,
|
|
unknown,
|
|
Action<string>
|
|
>;
|
|
|
|
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
|
|
export const useAppDispatch: () => AppDispatch = useDispatch;
|
|
|
|
export default store;
|