From a137a0a5c0408beec4ca4392c6b621874dff64ae Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Thu, 1 Sep 2022 10:03:59 +0900 Subject: [PATCH] fix --- app/src/helpers/throttle.ts | 2 +- app/src/pages/page.tsx | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/helpers/throttle.ts b/app/src/helpers/throttle.ts index f43afbc..5642e11 100644 --- a/app/src/helpers/throttle.ts +++ b/app/src/helpers/throttle.ts @@ -1,6 +1,6 @@ function throttle any>( fn: Fn, - ms: number + ms: number = 333 ): (...args: Parameters) => void { let throttledFn = () => undefined; let throttled: boolean = false; diff --git a/app/src/pages/page.tsx b/app/src/pages/page.tsx index 9cab838..35c3736 100644 --- a/app/src/pages/page.tsx +++ b/app/src/pages/page.tsx @@ -4,7 +4,6 @@ import Editor from "../components/editor"; import beforeunload from "../helpers/beforeunload"; import throttle from "../helpers/throttle"; -const intervalMs = 333; const { block, unblock } = beforeunload(); async function updatePage( @@ -50,8 +49,7 @@ export default (props: { id: number }) => { `/${content.text ? id.toString(16) : "new"}` ); } - }, - intervalMs + } ); function onUpdatePage(content: Pages.RequestContentPage) {