From bc9423c2b40e0997b5cb62b754e37b5a5db93c17 Mon Sep 17 00:00:00 2001 From: sjuhan123 Date: Mon, 25 Sep 2023 15:29:25 +0900 Subject: [PATCH] =?UTF-8?q?refactor=20#128:=20=EC=9E=98=EB=AA=BB=EB=90=9C?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 클린업 함수 내 로직 - 불필요한 async --- fe/src/hooks/useFetch/index.tsx | 2 +- fe/src/hooks/usePullToRefresh/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fe/src/hooks/useFetch/index.tsx b/fe/src/hooks/useFetch/index.tsx index f2f061407..f4ae5f9e2 100644 --- a/fe/src/hooks/useFetch/index.tsx +++ b/fe/src/hooks/useFetch/index.tsx @@ -21,7 +21,7 @@ const useFetch = ({ fetchFn, suspense = false }: useFetchProps) => { const [error, setError] = useState(null); const fetch = useCallback( - async ({ fetchFn }: fetchProps) => { + ({ fetchFn }: fetchProps) => { if (!fetchFn) return; setStatus(API_STATUS.LOADING); diff --git a/fe/src/hooks/usePullToRefresh/index.tsx b/fe/src/hooks/usePullToRefresh/index.tsx index 3db228a6d..292b5444a 100644 --- a/fe/src/hooks/usePullToRefresh/index.tsx +++ b/fe/src/hooks/usePullToRefresh/index.tsx @@ -84,7 +84,7 @@ const usePullToRefresh = ({ container.addEventListener('touchend', handleTouchEnd); return () => { - container.addEventListener('touchstart', handleTouchStart); + container.removeEventListener('touchstart', handleTouchStart); container.removeEventListener('touchmove', handleTouchMove); container.removeEventListener('touchend', handleTouchEnd); };