Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IEvented

Hierarchy

  • IEvented

Implemented by

Index

Methods

Methods

emit

  • emit(eventName: string, event?: GameEvent): any
  • Emits an event for target

    Parameters

    • eventName: string

      The name of the event to publish

    • Optional event: GameEvent

      Optionally pass an event data object to the handler

    Returns any

off

  • off(eventName: string, handler: function): any
  • Unsubscribe an event handler(s) from an event. If a specific handler is specified for an event, only that handler will be unsubscribed. Otherwise all handlers will be unsubscribed for that event.

    Parameters

    • eventName: string

      The name of the event to unsubscribe

    • handler: function

      Optionally the specific handler to unsubscribe

    Returns any

on

  • on(eventName: string, handler: function): any
  • Subscribe an event handler to a particular event name, multiple handlers per event name are allowed.

    Parameters

    • eventName: string

      The name of the event to subscribe to

    • handler: function

      The handler callback to fire on this event

    Returns any