aboutsummaryrefslogtreecommitdiff
path: root/src/hooks.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/hooks.ts')
-rw-r--r--src/hooks.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/hooks.ts b/src/hooks.ts
new file mode 100644
index 0000000..2e13fb8
--- /dev/null
+++ b/src/hooks.ts
@@ -0,0 +1,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>() \ No newline at end of file