I hereby claim:
- I am vitorfranca on github.
- I am vitorfranca (https://keybase.io/vitorfranca) on keybase.
- I have a public key ASBSZ7HGR4GYicMcJjee7YfghK_iDiLMAMNpkyMEBFgH2Ao
To claim this, I am signing this object:
import { useState, useEffect } from 'react' | |
export const useFetch = (url) => { | |
const [data, setData] = useState(null) | |
const [isLoading, setIsLoading] = useState(false) | |
const [hasError, setHasError] = useState(false) | |
const [errorMessage, setErrorMessage] = useState('') | |
const [refetchIndex, setRefetchIndex] = useState(0) | |
const refetch = () => setRefetchIndex((prevRefetchIndex) => prevRefetchIndex + 1) |
function degreesToRadians(degrees) { | |
return degrees * Math.PI / 180; | |
} | |
function distanceInKmBetweenEarthCoordinates(lat1, lon1, lat2, lon2) { | |
var earthRadiusKm = 6371; | |
var dLat = degreesToRadians(lat2-lat1); | |
var dLon = degreesToRadians(lon2-lon1); |
I hereby claim:
To claim this, I am signing this object: