aboutsummaryrefslogtreecommitdiff
path: root/jb-ui/src/hooks.ts
blob: 7f8db4bb328e51a93a941ce9fefd9a8295153358 (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