Merge pull request #1172 from PavanGangireddy/loading-spelling

Update spelling from useLoadiing to useLoading
This commit is contained in:
Mike Cao 2022-06-01 18:28:07 -07:00 committed by GitHub
commit d3fc27d255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,14 +5,14 @@ import useApi from './useApi';
export default function useFetch(url, options = {}, update = []) {
const [response, setResponse] = useState();
const [error, setError] = useState();
const [loading, setLoadiing] = useState(false);
const [loading, setLoading] = useState(false);
const [count, setCount] = useState(0);
const { get } = useApi();
const { params = {}, headers = {}, disabled, delay = 0, interval, onDataLoad } = options;
async function loadData(params) {
try {
setLoadiing(true);
setLoading(true);
setError(null);
const time = performance.now();
@ -32,7 +32,7 @@ export default function useFetch(url, options = {}, update = []) {
console.error(e);
setError(e);
} finally {
setLoadiing(false);
setLoading(false);
}
}