19 lines
465 B
TypeScript
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
|