mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-13 04:52:19 +00:00
7 lines
187 B
JavaScript
7 lines
187 B
JavaScript
export const debounce = (callback, wait) => {
|
|
let timeoutId = null;
|
|
return (context) => {
|
|
window.clearTimeout(timeoutId);
|
|
timeoutId = window.setTimeout(() => callback(), wait);
|
|
}
|
|
} |