Récupération de défis et tirage d'un nouveau défi via des boutons
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { useAppDispatch, useAppSelector } from "./useStore"
|
||||
import { GamePayload, setPlayerId, updateGameState, updateMoney } from "@/utils/features/game/gameSlice"
|
||||
import { GamePayload, setPlayerId, updateActiveChallengeId, updateGameState, updateMoney } from "@/utils/features/game/gameSlice"
|
||||
|
||||
export const useGame = () => useAppSelector((state) => state.game)
|
||||
export const useSetPlayerId = () => {
|
||||
@ -10,6 +10,10 @@ export const useUpdateMoney = () => {
|
||||
const dispatch = useAppDispatch()
|
||||
return (money: number) => dispatch(updateMoney(money))
|
||||
}
|
||||
export const useUpdateActiveChallengeId = () => {
|
||||
const dispatch = useAppDispatch()
|
||||
return (challengeActionId: number) => dispatch(updateActiveChallengeId(challengeActionId))
|
||||
}
|
||||
export const useUpdateGameState = () => {
|
||||
const dispatch = useAppDispatch()
|
||||
return (game: GamePayload) => dispatch(updateGameState(game))
|
||||
|
Reference in New Issue
Block a user