From a85ec594a77557e5f48c4cf1aa33680e0da94654 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Fri, 25 Nov 2022 19:25:35 +0100 Subject: [skip ci] docs docs docs --- src/utils/debounce.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/utils/debounce.ts') diff --git a/src/utils/debounce.ts b/src/utils/debounce.ts index d9e19de..6e5bba6 100644 --- a/src/utils/debounce.ts +++ b/src/utils/debounce.ts @@ -16,6 +16,13 @@ * along with this program. If not, see . */ +/** + * Returns a new function that will call the wrapped function + * after the specified delay. If the function is called again + * within the delay, the timer will be reset. + * @param func The function to wrap + * @param delay The delay in milliseconds + */ export function debounce(func: T, delay = 300): T { let timeout: NodeJS.Timeout; return function (...args: any[]) { -- cgit