summaryrefslogtreecommitdiff
path: root/src/hooks/useAPIClient.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/hooks/useAPIClient.ts')
-rw-r--r--src/hooks/useAPIClient.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/hooks/useAPIClient.ts b/src/hooks/useAPIClient.ts
index e992b42..c7e8d31 100644
--- a/src/hooks/useAPIClient.ts
+++ b/src/hooks/useAPIClient.ts
@@ -9,6 +9,8 @@ const fetcher = (endpoint: string) => get(endpoint).then(response => response.da
const hooks: any = {};
const registerServiceHooks = <Item = any>(service: string): void => {
+ if (hooks[service]) return;
+
const useList = (query = '', options = {}): Response<Item[]> => {
return useSWR(`/${service}${query}`, fetcher, options);
};