Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

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

David Luzarfa8c7abf50fe
diff --git a/src/utils.ts b/src/utils.ts
index cd6bc00ce6..22f86dc64c 100644
--- a/src/utils.ts
+++ b/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);