1
0
Fork 0
mirror of https://github.com/kou029w/quot.git synced 2025-01-31 22:38:07 +00:00

Compare commits

..

No commits in common. "4c8e0a6fa7ff010058e3ffef30703ca2e30a25da" and "3cd4337c0445afb608652b0ad238345dd4f472ed" have entirely different histories.

3 changed files with 5 additions and 3 deletions

View file

@ -9,7 +9,7 @@
"engines": { "engines": {
"node": "^18.7.0" "node": "^18.7.0"
}, },
"packageManager": "npm@8.19.0", "packageManager": "npm@8.18.0",
"dependencies": { "dependencies": {
"@exampledev/new.css": "^1.1.3", "@exampledev/new.css": "^1.1.3",
"@lexical/plain-text": "^0.3.11", "@lexical/plain-text": "^0.3.11",

View file

@ -1,6 +1,6 @@
function throttle<Fn extends (...args: any[]) => any>( function throttle<Fn extends (...args: any[]) => any>(
fn: Fn, fn: Fn,
ms: number = 333 ms: number
): (...args: Parameters<Fn>) => void { ): (...args: Parameters<Fn>) => void {
let throttledFn = () => undefined; let throttledFn = () => undefined;
let throttled: boolean = false; let throttled: boolean = false;

View file

@ -4,6 +4,7 @@ import Editor from "../components/editor";
import beforeunload from "../helpers/beforeunload"; import beforeunload from "../helpers/beforeunload";
import throttle from "../helpers/throttle"; import throttle from "../helpers/throttle";
const intervalMs = 333;
const { block, unblock } = beforeunload(); const { block, unblock } = beforeunload();
async function updatePage( async function updatePage(
@ -49,7 +50,8 @@ export default (props: { id: number }) => {
`/${content.text ? id.toString(16) : "new"}` `/${content.text ? id.toString(16) : "new"}`
); );
} }
} },
intervalMs
); );
function onUpdatePage(content: Pages.RequestContentPage) { function onUpdatePage(content: Pages.RequestContentPage) {