import type { AppThunkDispatch, RootState } from 'app/store/store'; | |
import type { TypedUseSelectorHook } from 'react-redux'; | |
import { useDispatch, useSelector, useStore } from 'react-redux'; | |
// Use throughout your app instead of plain `useDispatch` and `useSelector` | |
export const useAppDispatch = () => useDispatch<AppThunkDispatch>(); | |
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector; | |
export const useAppStore = () => useStore<RootState>(); | |