Method
on
(topic: string, callback: (event: string, payload: Record<string, any>) => void)
Source from the content-addressed store, hash-verified
| 32 | } |
| 33 | |
| 34 | on(topic: string, callback: (event: string, payload: Record<string, any>) => void) { |
| 35 | this.callbacks[topic] = this.callbacks[topic] || []; |
| 36 | this.callbacks[topic]?.push(callback); |
| 37 | } |
| 38 | |
| 39 | off(topic: string, callback: (event: string, payload: Record<string, any>) => void) { |
| 40 | const callbacks = (this.callbacks[topic] || []).filter((cb) => cb !== callback); |
Callers
nothing calls this directly
Tested by
no test coverage detected