Function createEventRegistration

  • Creates an event registration object.

    Type Parameters

    • T extends O

      The record mapping event names to their payload types.

    • K extends string | number | symbol

      The specific event name.

    • G extends O

      The game state type.

    Parameters

    • eventName: K

      The name of the event to listen for.

    • listener: ListenerFunction<T[K], G>

      The listener function that will be invoked when the event is emitted.

    • Optionalpriority: number

      The priority of the listener. Higher priority listeners are

    Returns EventRegistration<T, K, G>

    The created event registration object.