MCPcopy Create free account
hub / github.com/arctic-cli/interface / raw

Function raw

packages/arctic/src/bus/index.ts:90–105  ·  view source on GitHub ↗
(type: string, callback: (event: any) => void)

Source from the content-addressed store, hash-verified

88 }
89
90 function raw(type: string, callback: (event: any) => void) {
91 log.info("subscribing", { type })
92 const subscriptions = state().subscriptions
93 let match = subscriptions.get(type) ?? []
94 match.push(callback)
95 subscriptions.set(type, match)
96
97 return () => {
98 log.info("unsubscribing", { type })
99 const match = subscriptions.get(type)
100 if (!match) return
101 const index = match.indexOf(callback)
102 if (index === -1) return
103 match.splice(index, 1)
104 }
105 }
106}

Callers 2

subscribeFunction · 0.85
subscribeAllFunction · 0.85

Calls 4

stateFunction · 0.85
pushMethod · 0.80
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected