force-orange-2022/src/utils/useAction.ts
2022-01-24 14:31:24 +01:00

12 lines
242 B
TypeScript

import { useDispatch } from "react-redux"
const useAction = (action: (...args: any[]) => any): any => {
const dispatch = useDispatch()
return (...args: any[]) => {
dispatch(action(...args))
}
}
export default useAction