MCPcopy Create free account
hub / github.com/Comfy-Org/litegraph.js / dispatch

Method dispatch

src/LGraphCanvas.ts:299–302  ·  view source on GitHub ↗
(type: T, detail?: LGraphCanvasEventMap[T])

Source from the content-addressed store, hash-verified

297 dispatch<T extends keyof NeverNever<LGraphCanvasEventMap>>(type: T, detail: LGraphCanvasEventMap[T]): boolean
298 dispatch<T extends keyof PickNevers<LGraphCanvasEventMap>>(type: T): boolean
299 dispatch<T extends keyof LGraphCanvasEventMap>(type: T, detail?: LGraphCanvasEventMap[T]) {
300 const event = new CustomEvent(type as string, { detail, bubbles: true })
301 return this.canvas.dispatchEvent(event)
302 }
303
304 dispatchEvent<TEvent extends keyof LGraphCanvasEventMap>(type: TEvent, detail: LGraphCanvasEventMap[TEvent]) {
305 this.canvas.dispatchEvent(new CustomEvent(type, { detail }))

Callers 2

subgraphMethod · 0.95
setGraphMethod · 0.95

Calls 1

dispatchEventMethod · 0.65

Tested by

no test coverage detected