MCPcopy
hub / github.com/coder/code-server / event

Method event

src/common/emitter.ts:23–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21 private listeners: Array<Callback<T>> = []
22
23 public get event(): Event<T> {
24 return (cb: Callback<T>): Disposable => {
25 this.listeners.push(cb)
26
27 return {
28 dispose: (): void => {
29 const i = this.listeners.indexOf(cb)
30 if (i !== -1) {
31 this.listeners.splice(i, 1)
32 }
33 },
34 }
35 }
36 }
37
38 /**
39 * Emit an event with a value.

Callers 4

emitter.test.tsFile · 0.80
socket.test.tsFile · 0.80
getDataFunction · 0.80
createProxyMethod · 0.80

Calls

no outgoing calls

Tested by 1

getDataFunction · 0.64