diff --git a/src/utils.ts b/src/utils.ts index cd6bc00c..22f86dc6 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -131,9 +131,7 @@ export const debounce = ( }; ret.flush = () => { clearTimeout(handle); - if (lastArgs) { - fn(...lastArgs); - } + fn(...(lastArgs || [])); }; ret.cancel = () => { clearTimeout(handle);