Transmission plus immédiate via websockets

This commit is contained in:
2024-12-17 01:06:23 +01:00
parent 29c0a234d1
commit 0433e4695e
12 changed files with 448 additions and 12 deletions

View File

@ -1,6 +1,6 @@
import { LocationObject } from "expo-location"
import { useAppDispatch, useAppSelector } from "./useStore"
import { PlayerLocation, setLastLocation, setLastPlayerLocations, unqueueLocation } from "@/utils/features/location/locationSlice"
import { PlayerLocation, setLastLocation, setLastPlayerLocation, setLastPlayerLocations, unqueueLocation } from "@/utils/features/location/locationSlice"
export const useLastOwnLocation = () => useAppSelector((state) => state.location.lastOwnLocation)
export const useQueuedLocations = () => useAppSelector((state) => state.location.queuedLocations)
@ -18,3 +18,7 @@ export const useSetLastPlayerLocations = () => {
const dispatch = useAppDispatch()
return (playerLocations: PlayerLocation[]) => dispatch(setLastPlayerLocations(playerLocations))
}
export const useSetLastPlayerLocation = () => {
const dispatch = useAppDispatch()
return (playerLocation: PlayerLocation) => dispatch(setLastPlayerLocation(playerLocation))
}