keycloak-demo-frontend/src/hooks/useDispatch.tsx

10 lines
410 B
TypeScript

import { useDispatch as BaseUseDispatch } from 'react-redux';
import { Action, AnyAction } from 'redux';
import { ThunkDispatch } from 'redux-thunk';
import { StoreState } from '@Reducers/_InitializeStore/types';
export type UseDispatch<T extends Action = AnyAction> = () => ThunkDispatch<StoreState, Record<string, unknown>, T>;
const useDispatch: UseDispatch = BaseUseDispatch;
export default useDispatch;