mirror of
https://github.com/rookiestar28/ComfyUI-OpenClaw.git
synced 2026-08-14 08:52:45 +00:00
14 lines
341 B
JavaScript
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);
|
|
};
|
|
}
|