aboutsummaryrefslogtreecommitdiff
path: root/src/hooks.ts
diff options
context:
space:
mode:
authorMax Nanis2025-05-28 04:41:37 +0100
committerMax Nanis2025-05-28 04:41:37 +0100
commit8caa77413ea372e5cbd2980a9922d701af359c04 (patch)
tree9341e2f70fab6b2678fdff53c002954ef69c7b3e /src/hooks.ts
downloadpanel-ui-8caa77413ea372e5cbd2980a9922d701af359c04.tar.gz
panel-ui-8caa77413ea372e5cbd2980a9922d701af359c04.zip
initial commit
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