()
| 27 | if (!headings.some(Boolean)) return |
| 28 | let frame = 0 |
| 29 | const update = () => { |
| 30 | cancelAnimationFrame(frame) |
| 31 | frame = requestAnimationFrame(() => setActive(activeIndexOf(headings))) |
| 32 | } |
| 33 | update() |
| 34 | addEventListener("scroll", update, { passive: true }) |
| 35 | addEventListener("resize", update) |
no test coverage detected