MCPcopy Create free account
hub / github.com/arktypeio/arktype / update

Function update

ark/docs/components/shell/scrollspy.ts:29–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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)

Callers 1

useScrollspyFunction · 0.70

Calls 1

activeIndexOfFunction · 0.85

Tested by

no test coverage detected