mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
10 lines
171 B
JavaScript
10 lines
171 B
JavaScript
export function debounce(fn, delay) {
|
|
let timeoutId;
|
|
return (...args) => {
|
|
clearTimeout(timeoutId);
|
|
timeoutId = setTimeout(() => {
|
|
fn(...args)
|
|
}, delay);
|
|
};
|
|
}
|