InvokeAI/invokeai/frontend/web/src/app/storeHooks.ts
2023-03-03 00:02:15 -05:00

7 lines
343 B
TypeScript

import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';
import { AppDispatch, RootState } from './store';
// Use throughout your app instead of plain `useDispatch` and `useSelector`
export const useAppDispatch: () => AppDispatch = useDispatch;
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;