Récupération de défis et tirage d'un nouveau défi via des boutons

This commit is contained in:
2024-12-12 22:55:59 +01:00
parent 9d0b5cb254
commit 04f30e3ac2
12 changed files with 193 additions and 34 deletions

View File

@ -1,3 +1,8 @@
import { useAppSelector } from "./useStore"
import { ChallengesPayload, downloadChallenges } from "@/utils/features/challenges/challengesSlice"
import { useAppDispatch, useAppSelector } from "./useStore"
export const useChallenges = () => useAppSelector((state) => state.challenges)
export const useDownloadChallenges = () => {
const dispath = useAppDispatch()
return (challengesData: ChallengesPayload) => dispath(downloadChallenges(challengesData))
}