update bundle configs

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent c96052d8a4
commit 789cae98a1
4 changed files with 31 additions and 3 deletions

View File

@@ -48,13 +48,13 @@ export function throttle<T>(
let args = arguments;
if (remaining <= 0 || remaining > wait) {
if (timeout) {
clearTimeout(timeout);
window.clearTimeout(timeout);
timeout = null;
}
previous = now;
func.apply(context, args);
} else if (!timeout && options.trailing !== false) {
timeout = setTimeout(() => {
timeout = window.setTimeout(() => {
previous = options.leading === false ? 0 : Date.now();
timeout = null;
func.apply(context, args);