oca-ocb-core/odoo-bringout-oca-ocb-mail/mail/push-to-talk-extension/utils.js
Ernad Husremovic 2d3ee4855a 19.0 vanilla
2026-03-09 09:30:27 +01:00

12 lines
267 B
JavaScript

export function throttle(fn, delay) {
let timeout = null;
return function (...args) {
if (timeout === null) {
fn(...args);
timeout = setTimeout(() => {
timeout = null;
}, delay);
}
};
}