From 79dee23e185bf7c87c3d791c4b90eda3e3a95db8 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 30 Mar 2021 23:03:59 +0530 Subject: [PATCH] feat: review comments --- src/hooks/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/index.js b/src/hooks/index.js index cfc67a3..5f6c6d5 100644 --- a/src/hooks/index.js +++ b/src/hooks/index.js @@ -35,7 +35,7 @@ export const useGetTodos = (stale) => { useEffect(() => { let didCancel = false; - const getTodos = (async () => { + const getTodos = async () => { dispatch({ type: FetchState.FETCH_INIT }); try { const data = await api.listDocuments(Server.collectionID); @@ -47,7 +47,7 @@ export const useGetTodos = (stale) => { dispatch({ type: FetchState.FETCH_FAILURE }); } } - })(); + }; getTodos(); return () => (didCancel = true); }, [stale]);