MCPcopy
hub / github.com/anomalyco/opencode / subscribe

Function subscribe

packages/desktop/src/main/updater-controller.ts:68–72  ·  view source on GitHub ↗
(listener: (state: UpdaterState) => void)

Source from the content-addressed store, hash-verified

66 return {
67 getState: () => state,
68 subscribe(listener: (state: UpdaterState) => void) {
69 listeners.add(listener)
70 listener(state)
71 return () => listeners.delete(listener)
72 },
73 async start() {
74 const ready = await input.persistence.get()
75 if (ready?.version === input.currentVersion) await input.persistence.clear()

Callers

nothing calls this directly

Calls 3

addMethod · 0.65
listenerFunction · 0.50
deleteMethod · 0.45

Tested by

no test coverage detected