ソースを参照

fix: debounce.flush not invoked if lastArgs not defined (#3281)

David Luzar 4 年 前
コミット
fa8c7abf50
1 ファイル変更1 行追加3 行削除
  1. 1 3
      src/utils.ts

+ 1 - 3
src/utils.ts

@@ -131,9 +131,7 @@ export const debounce = <T extends any[]>(
   };
   ret.flush = () => {
     clearTimeout(handle);
-    if (lastArgs) {
-      fn(...lastArgs);
-    }
+    fn(...(lastArgs || []));
   };
   ret.cancel = () => {
     clearTimeout(handle);