You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

5 lines
355 B

  1. import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'
  2. import type { RootState, AppDispatch } from '../store'
  3. // 在整个应用程序中使用,而不是简单的 `useDispatch` 和 `useSelector`
  4. export const useAppDispatch: () => AppDispatch = useDispatch
  5. export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector