traintrape-moi/client/hooks/useChallengeActions.ts

9 lines
485 B
TypeScript
Raw Permalink Normal View History

import { ChallengeActionsPayload, downloadChallengeActions } from "@/utils/features/challengeActions/challengeActionsSlice"
import { useAppDispatch, useAppSelector } from "./useStore"
2024-12-11 16:26:36 +00:00
export const useChallengeActions = () => useAppSelector((state) => state.challengeActions.challengeActions)
export const useDownloadChallengeActions = () => {
const dispath = useAppDispatch()
return (challengesData: ChallengeActionsPayload) => dispath(downloadChallengeActions(challengesData))
}