mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-07 16:33:51 +00:00
6ac963684d
* chore: upgrade minor versions * chore: upgrade cypress * chore: upgrade fe dependencies * update readme * update osx images * update readme * upgrade dependencies * upgrade test dependency * feat: add option to input autofill * feat: autofill to the left * chore: update docs * chore: cleanup ci * version bump * style: prevent zero height bar * fix: prevent loosing menu * ux: improve input, no spellcheck or autocomplete * small ux improvements in cuesheets * feat 111/increase maximum number of events * fix: optimistic delete issue with filter * refact: pincode workflow * chore: add versioning to packages
18 lines
441 B
JavaScript
18 lines
441 B
JavaScript
import { useQuery } from 'react-query';
|
|
const refetchIntervalMs = 10000;
|
|
|
|
/**
|
|
* @description utility hook to simplify query config
|
|
* @param namespace
|
|
* @param fn
|
|
*/
|
|
export const useFetch = (namespace, fn) => {
|
|
const { data, status, isError, refetch } = useQuery(namespace, fn, {
|
|
refetchInterval: refetchIntervalMs,
|
|
cacheTime: Infinity,
|
|
notifyOnChangeProps: 'tracked',
|
|
});
|
|
|
|
return { data, status, isError, refetch };
|
|
};
|