MCPcopy
hub / github.com/hotwired/stimulus / invokeWithEvent

Method invokeWithEvent

src/core/binding.ts:74–84  ·  view source on GitHub ↗
(event: ActionEvent)

Source from the content-addressed store, hash-verified

72 }
73
74 private invokeWithEvent(event: ActionEvent) {
75 const { target, currentTarget } = event
76 try {
77 this.method.call(this.controller, event)
78 this.context.logDebugActivity(this.methodName, { event, target, currentTarget, action: this.methodName })
79 } catch (error: any) {
80 const { identifier, controller, element, index } = this
81 const detail = { identifier, controller, element, index, event }
82 this.context.handleError(error, `invoking action "${this.action}"`, detail)
83 }
84 }
85
86 private willBeInvokedByEvent(event: Event): boolean {
87 const eventTarget = event.target

Callers 1

handleEventMethod · 0.95

Calls 1

handleErrorMethod · 0.65

Tested by

no test coverage detected