implementing download

This commit is contained in:
2024-02-09 10:47:18 +01:00
parent e7e4d03baf
commit 453cd2a373
21 changed files with 569 additions and 62 deletions

View File

@@ -81,4 +81,13 @@ export const base64URLEncode = (s: string) => pipe(
s => String.fromCodePoint(...new TextEncoder().encode(s)),
btoa,
encodeURIComponent
)
)
export const debounce = (callback: Function, wait = 300) => {
let timeout: ReturnType<typeof setTimeout>
return (...args: any[]) => {
clearTimeout(timeout)
timeout = setTimeout(() => callback(...args), wait)
}
}