MCPcopy
hub / github.com/shipshapecode/shepherd / trigger

Method trigger

shepherd.js/src/evented.ts:78–94  ·  view source on GitHub ↗
(event: string, ...args: any[])

Source from the content-addressed store, hash-verified

76 */
77 // eslint-disable-next-line @typescript-eslint/no-explicit-any
78 trigger(event: string, ...args: any[]) {
79 if (!isUndefined(this.bindings) && this.bindings[event]) {
80 this.bindings[event]?.forEach((binding, index) => {
81 const { ctx, handler, once } = binding;
82
83 const context = ctx || this;
84
85 handler.apply(context, args as []);
86
87 if (once) {
88 this.bindings[event]?.splice(index, 1);
89 }
90 });
91 }
92
93 return this;
94 }
95}

Callers 13

evented.spec.jsFile · 0.80
bind.spec.jsFile · 0.80
a11y.cy.jsFile · 0.80
constructorMethod · 0.80
showMethod · 0.80
startMethod · 0.80
_doneMethod · 0.80
_setupActiveTourMethod · 0.80
cancelMethod · 0.80
completeMethod · 0.80
destroyMethod · 0.80
hideMethod · 0.80

Calls 1

isUndefinedFunction · 0.90

Tested by

no test coverage detected