mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-19 21:00:14 +08:00
13 lines
265 B
JavaScript
13 lines
265 B
JavaScript
// helper functions
|
|
|
|
function debounce(func, wait_time) {
|
|
let timeout;
|
|
return function wrapped(...args) {
|
|
let call_function = () => {
|
|
clearTimeout(timeout);
|
|
func(...args)
|
|
}
|
|
clearTimeout(timeout);
|
|
timeout = setTimeout(call_function, wait_time);
|
|
};
|
|
} |