diff options
| author | Melonai <einebeere@gmail.com> | 2021-03-24 09:51:36 +0100 |
|---|---|---|
| committer | Melonai <einebeere@gmail.com> | 2021-03-24 09:51:36 +0100 |
| commit | 42860fa15985401825d8d51e73ec497fe5876710 (patch) | |
| tree | daa43dd5f4ac77e46dbdd78b1a07811fa5db755c /client/src/utils/debounce.ts | |
| parent | 5dde1f55d818a74e838afa37b0e20217b1549a83 (diff) | |
| download | shorest-42860fa15985401825d8d51e73ec497fe5876710.tar.zst shorest-42860fa15985401825d8d51e73ec497fe5876710.zip | |
Update SvelteKit to public beta
Diffstat (limited to 'client/src/utils/debounce.ts')
| -rw-r--r-- | client/src/utils/debounce.ts | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/client/src/utils/debounce.ts b/client/src/utils/debounce.ts deleted file mode 100644 index 86ef3db..0000000 --- a/client/src/utils/debounce.ts +++ /dev/null @@ -1,12 +0,0 @@ -type Procedure = (...args: any[]) => any; - -export default function <F extends Procedure>(f: F, duration: number) { - let timeout: ReturnType<typeof setTimeout> | null = null; - return function (...args: Parameters<F>) { - if (timeout !== null) { - clearTimeout(timeout); - timeout = null; - } - timeout = setTimeout(() => f(...args), duration); - }; -} |
