feat: add mobile ui to calendar
This commit is contained in:
10
utils/debounce.ts
Normal file
10
utils/debounce.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export function debounce(func: Function, delay = 300) {
|
||||
let debounceTimer: ReturnType<typeof setTimeout>
|
||||
return function () {
|
||||
// @ts-expect-error this in TypeScript
|
||||
const context = this
|
||||
const args = arguments
|
||||
clearTimeout(debounceTimer)
|
||||
debounceTimer = setTimeout(() => func.apply(context, args), delay)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user