Stockage du jeton d'authentification dans le store local, permettant l'utilisation de hooks

This commit is contained in:
2024-12-10 18:56:50 +01:00
parent 72862da3a6
commit 363dfa5c74
8 changed files with 108 additions and 31 deletions

View File

@ -3,7 +3,7 @@ import { useAppDispatch, useAppSelector } from "./useStore"
import { setLocation } from "@/utils/features/location/locationSlice"
export const useLocation = () => useAppSelector((state) => state.location.location)
export const useSetLocation = () => (location: LocationObject) => {
export const useSetLocation = () => {
const dispatch = useAppDispatch()
dispatch(setLocation(location))
return (location: LocationObject) => dispatch(setLocation(location))
}