MCPcopy
hub / github.com/ifandelse/machina.js / on

Method on

packages/machina/src/fsm.ts:169–174  ·  view source on GitHub ↗
(eventName: string, callback: (...args: any[]) => void)

Source from the content-addressed store, hash-verified

167 ): Subscription;
168 on(eventName: "*", callback: (eventName: string, data: unknown) => void): Subscription;
169 on(eventName: string, callback: (...args: any[]) => void): Subscription {
170 if (this.disposed) {
171 return { off() {} };
172 }
173 return this.emitter.on(eventName as any, callback as any);
174 }
175
176 /**
177 * Emit a custom event through the FSM. Built-in lifecycle events are

Callers 15

constructorMethod · 0.45
emitter.test.tsFile · 0.45
fsm.test.tsFile · 0.45
runSingleWalkFunction · 0.45
wireInspectorFunction · 0.45
fsm.test.tsFile · 0.45
main.tsFile · 0.45
fsm.test.tsFile · 0.45
main.tsFile · 0.45
fsm.test.tsFile · 0.45
fsm.test.tsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected