fix: debounce.flush not invoked if lastArgs not defined (#3281)
This commit is contained in:
parent
c3ecbcb3ab
commit
fa8c7abf50
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user