9 lines
425 B
TypeScript
9 lines
425 B
TypeScript
import { ChallengesPayload, downloadChallenges } from "@/utils/features/challenges/challengesSlice"
|
|
import { useAppDispatch, useAppSelector } from "./useStore"
|
|
|
|
export const useChallenges = () => useAppSelector((state) => state.challenges.challenges)
|
|
export const useDownloadChallenges = () => {
|
|
const dispath = useAppDispatch()
|
|
return (challengesData: ChallengesPayload) => dispath(downloadChallenges(challengesData))
|
|
}
|