Framework updates
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
8
node_modules/axios/lib/helpers/throttle.js
generated
vendored
8
node_modules/axios/lib/helpers/throttle.js
generated
vendored
@@ -18,23 +18,23 @@ function throttle(fn, freq) {
|
||||
timer = null;
|
||||
}
|
||||
fn(...args);
|
||||
}
|
||||
};
|
||||
|
||||
const throttled = (...args) => {
|
||||
const now = Date.now();
|
||||
const passed = now - timestamp;
|
||||
if ( passed >= threshold) {
|
||||
if (passed >= threshold) {
|
||||
invoke(args, now);
|
||||
} else {
|
||||
lastArgs = args;
|
||||
if (!timer) {
|
||||
timer = setTimeout(() => {
|
||||
timer = null;
|
||||
invoke(lastArgs)
|
||||
invoke(lastArgs);
|
||||
}, threshold - passed);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const flush = () => lastArgs && invoke(lastArgs);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user