porridger/front/src/hooks/api/useOsmAddress.ts
2023-07-16 00:08:51 +03:00

19 lines
465 B
TypeScript

import { LatLng } from 'leaflet'
import { useFetch } from '../'
import { composeOsmAddressURL, processOsmAddress } from '../../api/osmAddress'
import { isOsmAddressResponse } from '../../api/osmAddress/types'
const useOsmAddresses = (addressPosition: LatLng) => (
useFetch(
composeOsmAddressURL(addressPosition),
'GET',
false,
isOsmAddressResponse,
processOsmAddress,
''
)
)
export default useOsmAddresses