Affichage des dernières positions sur la carte
This commit is contained in:
@ -1,9 +1,10 @@
|
||||
import { LocationObject } from "expo-location"
|
||||
import { useAppDispatch, useAppSelector } from "./useStore"
|
||||
import { setLastLocation, unqueueLocation } from "@/utils/features/location/locationSlice"
|
||||
import { PlayerLocation, setLastLocation, setLastPlayerLocations, unqueueLocation } from "@/utils/features/location/locationSlice"
|
||||
|
||||
export const useLastOwnLocation = () => useAppSelector((state) => state.location.lastOwnLocation)
|
||||
export const useQueuedLocations = () => useAppSelector((state) => state.location.queuedLocations)
|
||||
export const useLastPlayerLocations = () => useAppSelector((state) => state.location.lastPlayerLocations)
|
||||
|
||||
export const useSetLastLocation = () => {
|
||||
const dispatch = useAppDispatch()
|
||||
@ -13,3 +14,7 @@ export const useUnqueueLocation = () => {
|
||||
const dispatch = useAppDispatch()
|
||||
return (location: LocationObject) => dispatch(unqueueLocation(location))
|
||||
}
|
||||
export const useSetLastPlayerLocations = () => {
|
||||
const dispatch = useAppDispatch()
|
||||
return (playerLocations: PlayerLocation[]) => dispatch(setLastPlayerLocations(playerLocations))
|
||||
}
|
||||
|
Reference in New Issue
Block a user