mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
Update spelling from useLoadiing to useLoading
This commit is contained in:
parent
f55ba7bd80
commit
6a88f3e7f4
@ -5,14 +5,14 @@ import useApi from './useApi';
|
|||||||
export default function useFetch(url, options = {}, update = []) {
|
export default function useFetch(url, options = {}, update = []) {
|
||||||
const [response, setResponse] = useState();
|
const [response, setResponse] = useState();
|
||||||
const [error, setError] = useState();
|
const [error, setError] = useState();
|
||||||
const [loading, setLoadiing] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [count, setCount] = useState(0);
|
const [count, setCount] = useState(0);
|
||||||
const { get } = useApi();
|
const { get } = useApi();
|
||||||
const { params = {}, headers = {}, disabled, delay = 0, interval, onDataLoad } = options;
|
const { params = {}, headers = {}, disabled, delay = 0, interval, onDataLoad } = options;
|
||||||
|
|
||||||
async function loadData(params) {
|
async function loadData(params) {
|
||||||
try {
|
try {
|
||||||
setLoadiing(true);
|
setLoading(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
const time = performance.now();
|
const time = performance.now();
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ export default function useFetch(url, options = {}, update = []) {
|
|||||||
console.error(e);
|
console.error(e);
|
||||||
setError(e);
|
setError(e);
|
||||||
} finally {
|
} finally {
|
||||||
setLoadiing(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user