aboutsummaryrefslogtreecommitdiff
path: root/src/hooks.ts
blob: 2e13fb82db347168f394886ab4f8542f2001269f (plain)
1
2
3
4
5
6
7
// This file serves as a central hub for re-exporting pre-typed Redux hooks.
import { useDispatch, useSelector } from 'react-redux'
import type { AppDispatch, RootState } from '@/store.ts'

// Use throughout your app instead of plain `useDispatch` and `useSelector`
export const useAppDispatch = useDispatch.withTypes<AppDispatch>()
export const useAppSelector = useSelector.withTypes<RootState>()