fix monaco.

This commit is contained in:
2023-01-12 09:36:13 +08:00
parent 75e6906c16
commit ab5cb8610b
20 changed files with 281 additions and 132 deletions

View File

@@ -49,3 +49,13 @@ export function submissionTimeFormat(time: number) {
if (time === undefined) return "--"
return time + "ms"
}
export function debounce(fn: Function, n = 100) {
let handle: any
return (...args: any[]) => {
if (handle) clearTimeout(handle)
handle = setTimeout(() => {
fn(...args)
}, n)
}
}