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


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

export const useAppDispatch: () => AppDispatch = useDispatch
// export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector