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

Method emit

src/common/emitter.ts:41–56  ·  view source on GitHub ↗

* Emit an event with a value.

(value: T)

Source from the content-addressed store, hash-verified

39 * Emit an event with a value.
40 */
41 public async emit(value: T): Promise<void> {
42 let resolve: () => void
43 const promise = new Promise<void>((r) => (resolve = r))
44
45 await Promise.all(
46 this.listeners.map(async (cb) => {
47 try {
48 await cb(value, promise)
49 } catch (error: any) {
50 logger.error(error.message)
51 }
52 }),
53 )
54
55 resolve!()
56 }
57
58 public dispose(): void {
59 this.listeners = []

Callers 8

emitter.test.tsFile · 0.80
app.test.tsFile · 0.80
masterBallFunction · 0.80
socket.test.tsFile · 0.80
startProxyServerMethod · 0.80
constructorFunction · 0.80
constructorMethod · 0.80
setStateMethod · 0.80

Calls

no outgoing calls

Tested by 1

masterBallFunction · 0.64