From c4738b31fb4144558d25b812a29c09c1cc883cd1 Mon Sep 17 00:00:00 2001 From: zsviczian Date: Tue, 4 Apr 2023 13:18:51 +0200 Subject: [PATCH] Update utils.ts --- src/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 0b7d6df89..3e2979583 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -135,7 +135,7 @@ export const throttleRAF = ( let timerId: number | null = null; let lastArgs: T | null = null; let lastArgsTrailing: T | null = null; - let watchdog: NodeJS.Timeout | null = null; + let watchdog: number | null = null; const scheduleFunc = (args: T) => { timerId = window.requestAnimationFrame(() => { @@ -189,13 +189,13 @@ export const throttleRAF = ( } } }; - watchdog = setTimeout(() => { + watchdog = window.setTimeout(() => { console.log("watchdog", timerId); if (timerId !== null) { cancelAnimationFrame(timerId); timerId = null; } - },1000); + }, 1000); return ret; };