MCPcopy Index your code
hub / github.com/upstash/jstack / off

Method off

packages/jstack-shared/src/event-emitter.ts:112–127  ·  view source on GitHub ↗
(event: string, callback?: (data: any) => any)

Source from the content-addressed store, hash-verified

110 }
111
112 off(event: string, callback?: (data: any) => any) {
113 if (!callback) {
114 this.eventHandlers.delete(event as string)
115 } else {
116 const handlers = this.eventHandlers.get(event as string)
117 if (handlers) {
118 const index = handlers.indexOf(callback)
119 if (index !== -1) {
120 handlers.splice(index, 1)
121 if (handlers.length === 0) {
122 this.eventHandlers.delete(event as string)
123 }
124 }
125 }
126 }
127 }
128
129 on(event: string, callback?: (data: any) => any): void {
130 if (!callback) {

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected