MCPcopy Create free account
hub / github.com/anomalyco/opencode / move

Function move

packages/ui/src/components/select.tsx:58–70  ·  view source on GitHub ↗
(item: T | undefined)

Source from the content-addressed store, hash-verified

56 const keyFor = (item: T) => (local.value ? local.value(item) : (item as string))
57
58 const move = (item: T | undefined) => {
59 if (!local.onHighlight) return
60 if (!item) {
61 stop()
62 return
63 }
64
65 const key = keyFor(item)
66 if (state.key === key) return
67 state.cleanup?.()
68 state.cleanup = local.onHighlight(item)
69 state.key = key
70 }
71
72 onCleanup(stop)
73

Callers 1

SelectFunction · 0.70

Calls 2

stopFunction · 0.70
keyForFunction · 0.70

Tested by

no test coverage detected