traintrape-moi/client/hooks/useChallengeActions.ts

9 lines
485 B
TypeScript

import { ChallengeActionsPayload, downloadChallengeActions } from "@/utils/features/challengeActions/challengeActionsSlice"
import { useAppDispatch, useAppSelector } from "./useStore"
export const useChallengeActions = () => useAppSelector((state) => state.challengeActions.challengeActions)
export const useDownloadChallengeActions = () => {
const dispath = useAppDispatch()
return (challengesData: ChallengeActionsPayload) => dispath(downloadChallengeActions(challengesData))
}