traintrape-moi/client/hooks/useChallenges.ts

9 lines
425 B
TypeScript
Raw Permalink Normal View History

import { ChallengesPayload, downloadChallenges } from "@/utils/features/challenges/challengesSlice"
import { useAppDispatch, useAppSelector } from "./useStore"
2024-12-11 16:26:36 +00:00
export const useChallenges = () => useAppSelector((state) => state.challenges.challenges)
export const useDownloadChallenges = () => {
const dispath = useAppDispatch()
return (challengesData: ChallengesPayload) => dispath(downloadChallenges(challengesData))
}