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) {