(listener: () => void)
| 73 | }; |
| 74 | |
| 75 | const subscribe = (listener: () => void) => { |
| 76 | if (listeners.size === 0) { |
| 77 | lastY = window.scrollY; |
| 78 | window.addEventListener('scroll', onScroll, { passive: true }); |
| 79 | } |
| 80 | listeners.add(listener); |
| 81 | |
| 82 | return () => { |
| 83 | listeners.delete(listener); |
| 84 | if (listeners.size === 0) { |
| 85 | window.removeEventListener('scroll', onScroll); |
| 86 | } |
| 87 | }; |
| 88 | }; |
| 89 | |
| 90 | // A thing's page keeps the block until its hero has gone and what docks |
| 91 | // into the block (the name, Follow, the segments) has had room to arrive. |
nothing calls this directly
no outgoing calls
no test coverage detected