Files
2026-02-09 23:51:24 +08:00

14 lines
341 B
JavaScript

/**
* Simple debounce utility (R54 UI Guard).
* Prevents rapid-fire API calls (e.g. test connection spam).
*/
export function debounce(func, wait) {
let timeout;
return function (...args) {
const context = this;
clearTimeout(timeout);
timeout = setTimeout(() => func.apply(context, args), wait);
};
}