(func: any, delay: any)
| 52 | }; |
| 53 | |
| 54 | const debounce = (func: any, delay: any) => { |
| 55 | let timeoutId: any; |
| 56 | return (...args: any) => { |
| 57 | clearTimeout(timeoutId); |
| 58 | timeoutId = setTimeout(() => { |
| 59 | func(...args); |
| 60 | }, delay); |
| 61 | }; |
| 62 | }; |
| 63 | |
| 64 | const debouncedHandleScroll = debounce(() => { |
| 65 | const currentScrollPos = window.scrollY; |