MCPcopy Create free account
hub / github.com/melonjs/melonJS / on

Function on

packages/melonjs/src/system/event.ts:452–458  ·  view source on GitHub ↗
(
	eventName: E,
	listener: Events[E],
	context?: any,
)

Source from the content-addressed store, hash-verified

450 * me.event.on("event-name", myFunction, this);
451 */
452export function on<E extends keyof Events>(
453 eventName: E,
454 listener: Events[E],
455 context?: any,
456) {
457 return eventEmitter.addListener(eventName, listener, context);
458}
459
460/**
461 * Add a one-time listener for a given event.

Callers 15

_subscribeMethod · 0.90
constructorMethod · 0.90
state.tsFile · 0.90
constructorMethod · 0.90
initMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90
initEventsMethod · 0.90
constructorMethod · 0.90
onActivateEventMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90

Calls 1

addListenerMethod · 0.80

Tested by

no test coverage detected