mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-16 14:00:56 +02:00
fix: debounce.flush not invoked if lastArgs not defined (#3281)
This commit is contained in:
@@ -131,9 +131,7 @@ export const debounce = <T extends any[]>(
|
|||||||
};
|
};
|
||||||
ret.flush = () => {
|
ret.flush = () => {
|
||||||
clearTimeout(handle);
|
clearTimeout(handle);
|
||||||
if (lastArgs) {
|
fn(...(lastArgs || []));
|
||||||
fn(...lastArgs);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
ret.cancel = () => {
|
ret.cancel = () => {
|
||||||
clearTimeout(handle);
|
clearTimeout(handle);
|
||||||
|
Reference in New Issue
Block a user