mail/push-to-talk-extension/utils.js
Данил Воробьев 6e6f15d803 initial commit
2024-05-03 09:40:35 +00:00

13 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);
}
};
}