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

Function once

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

Source from the content-addressed store, hash-verified

466 * me.event.once("event-name", myFunction, this);
467 */
468export function once<E extends keyof Events>(
469 eventName: E,
470 listener: Events[E],
471 context?: any,
472) {
473 eventEmitter.addListenerOnce(eventName, listener, context);
474}
475
476/**
477 * remove the given listener for a given event.

Callers 5

state.tsFile · 0.90
save.tsFile · 0.90
constructorMethod · 0.90
onResetEventMethod · 0.90

Calls 1

addListenerOnceMethod · 0.80

Tested by

no test coverage detected