From d3a7afde9782433d0b5dc79193f6762790f75da1 Mon Sep 17 00:00:00 2001 From: 79E <5980844@qq.com> Date: Sat, 31 Dec 2022 10:52:56 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E4=BF=AE=E6=94=B9useTimeout=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E8=BF=94=E5=9B=9E=E7=B1=BB=E5=9E=8B=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/use-timeout.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hooks/use-timeout.ts b/src/hooks/use-timeout.ts index 9a2f257..b43c2d5 100644 --- a/src/hooks/use-timeout.ts +++ b/src/hooks/use-timeout.ts @@ -1,17 +1,17 @@ import { useRef, useCallback } from 'react'; -interface IUseTimeoutReturn { +type UseTimeoutReturn = { /** 启动计时器,入参为延时到期的回调函数 */ startTimer: (callback: () => void, delay?: number) => void; /** 清楚计时器 */ clearTimer: {}; -} +}; /** * 延迟调用 * @returns 返回开始定时器和清楚定时器的方法 */ -const useTimeout = (): IUseTimeoutReturn => { +export const useTimeout = (): UseTimeoutReturn => { const timerRef = useRef(null); const clearTimer = useCallback(() => {