mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-09-11 13:56:29 +02:00
days wishes components
This commit is contained in:
11
src/utils/useAction.ts
Normal file
11
src/utils/useAction.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { useDispatch } from "react-redux"
|
||||
|
||||
const useAction = (action: (...args: any[]) => any): any => {
|
||||
const dispatch = useDispatch()
|
||||
|
||||
return (...args: any[]) => {
|
||||
dispatch(action(...args))
|
||||
}
|
||||
}
|
||||
|
||||
export default useAction
|
Reference in New Issue
Block a user