Refact/project (#189)

* refactor: cleanup project entry point
* refactor: remove unused
* refactor: folder restructure
This commit is contained in:
Carlos Valente
2022-08-03 23:20:23 +02:00
committed by GitHub
parent 05be0c1e95
commit 9b5d536378
116 changed files with 352 additions and 942 deletions
+17
View File
@@ -0,0 +1,17 @@
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 };
};