()
| 52 | return undefined; |
| 53 | } |
| 54 | const callback = () => { |
| 55 | setIsCompact( |
| 56 | document.documentElement.scrollTop >= window.innerHeight / 2, |
| 57 | ); |
| 58 | }; |
| 59 | callback(); |
| 60 | window.addEventListener('scroll', callback, { passive: true }); |
| 61 | return () => window.removeEventListener('scroll', callback); |
no outgoing calls