2024-12-06 20:49:28 +00:00
|
|
|
import { LocationObject } from "expo-location"
|
|
|
|
import { useAppDispatch, useAppSelector } from "./useStore"
|
|
|
|
import { setLocation } from "@/utils/features/location/locationSlice"
|
|
|
|
|
|
|
|
export const useLocation = () => useAppSelector((state) => state.location.location)
|
2024-12-10 17:56:50 +00:00
|
|
|
export const useSetLocation = () => {
|
2024-12-06 20:49:28 +00:00
|
|
|
const dispatch = useAppDispatch()
|
2024-12-10 17:56:50 +00:00
|
|
|
return (location: LocationObject) => dispatch(setLocation(location))
|
2024-12-06 20:49:28 +00:00
|
|
|
}
|