MCPcopy Index your code
hub / github.com/anomalyco/opencode / handler

Function handler

packages/opencode/test/server/global-bus.ts:12–21  ·  view source on GitHub ↗
(event: GlobalEvent)

Source from the content-addressed store, hash-verified

10 const cleanup = () => GlobalBus.off("event", handler)
11
12 const handler = (event: GlobalEvent) => {
13 try {
14 if (!input.predicate(event)) return
15 cleanup()
16 resume(Effect.succeed(event))
17 } catch (error) {
18 cleanup()
19 resume(Effect.fail(error))
20 }
21 }
22
23 GlobalBus.on("event", handler)
24 return Effect.sync(cleanup)

Callers 9

fetchFunction · 0.70
requestFunction · 0.70
appFunction · 0.70
makeServerFunction · 0.50
mockHttpClientFunction · 0.50
mockSpawnerFunction · 0.50
lifecycle.test.tsFile · 0.50

Calls 2

resumeFunction · 0.85
cleanupFunction · 0.70

Tested by 7

fetchFunction · 0.56
requestFunction · 0.56
appFunction · 0.56
makeServerFunction · 0.40
mockHttpClientFunction · 0.40
mockSpawnerFunction · 0.40