ui: move debouncecall

This commit is contained in:
nick-delirium 2025-04-28 10:30:06 +02:00 committed by Delirium
parent f8ba3f6d89
commit 91f8cc1399

View file

@ -29,6 +29,16 @@ export function debounce(callback, wait, context = this) {
};
}
export function debounceCall(func, wait) {
let timeout;
return function (...args) {
const context = this;
clearTimeout(timeout);
timeout = setTimeout(() => func.apply(context, args), wait);
};
}
export function randomInt(a, b) {
const min = (b ? a : 0) - 0.5;
const max = b || a || Number.MAX_SAFE_INTEGER;