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

Function push

packages/tui/src/keymap.tsx:73–87  ·  view source on GitHub ↗
(mode: string)

Source from the content-addressed store, hash-verified

71 return stack.at(-1)?.mode ?? OPENCODE_BASE_MODE
72 },
73 push(mode: string) {
74 if (disposed) return () => {}
75 const id = Symbol(mode)
76 let active = true
77 stack.push({ id, mode })
78 update()
79
80 return () => {
81 if (!active) return
82 active = false
83 const index = stack.findIndex((item) => item.id === id)
84 if (index !== -1) stack.splice(index, 1)
85 update()
86 }
87 },
88 dispose() {
89 if (disposed) return
90 disposed = true

Callers

nothing calls this directly

Calls 2

pushMethod · 0.80
updateFunction · 0.70

Tested by

no test coverage detected