12 lines
488 B
TypeScript
Raw Normal View History

2022-09-28 20:04:00 -06:00
import { useDispatch, useSelector } from 'react-redux';
import type { RootState } from './index';
2022-09-28 20:04:00 -06:00
import type { TypedUseSelectorHook } from 'react-redux';
import type { AnyAction, ThunkDispatch } from '@reduxjs/toolkit';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type AppDispatch = ThunkDispatch<RootState, any, AnyAction>;
2022-09-28 20:04:00 -06:00
export const useAppDispatch = () => useDispatch<AppDispatch>();
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;