mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-06-13 11:04:19 +02:00
12 lines
242 B
TypeScript
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
|