diff options
Diffstat (limited to 'server/helpers/debounce.ts')
-rw-r--r-- | server/helpers/debounce.ts | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/server/helpers/debounce.ts b/server/helpers/debounce.ts deleted file mode 100644 index 77d99a894..000000000 --- a/server/helpers/debounce.ts +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | export function Debounce (config: { timeoutMS: number }) { | ||
2 | let timeoutRef: NodeJS.Timeout | ||
3 | |||
4 | return function (_target, _key, descriptor: PropertyDescriptor) { | ||
5 | const original = descriptor.value | ||
6 | |||
7 | descriptor.value = function (...args: any[]) { | ||
8 | clearTimeout(timeoutRef) | ||
9 | |||
10 | timeoutRef = setTimeout(() => { | ||
11 | original.apply(this, args) | ||
12 | |||
13 | }, config.timeoutMS) | ||
14 | } | ||
15 | } | ||
16 | } | ||