Skip to content

ym.core.EventEmitter

Initialization

var eventEmitter = new ym.core.EventEmitter(nameopt, forceDebugopt);

Constructor(nameopt, forceDebug)

  • name
  • Description: The name of the class used as a prefix.
  • Data type: string
  • Default value: ym.core.EventEmitter

  • forceDebug

  • Description: Enables or disables logging.
  • Data type: bool
  • Default value: false

Methods

Writes a message in the developer tool that informs about an obsolete component.

  • Parameters
  • component

    • Description: The component that is marked as obsolete.
    • Data type: function
  • link

    • Description: The link to the documentation of the new or changed component.
    • Data type: string
  • expirationDate

    • Description: The date on which the component is removed.
    • Data type: date

emit(eventName, arguments)

Triggers an event.

  • Parameters
  • eventName

    • Data type: string
  • arguments

    • Data type: *
  • Return: ym.core.EventEmitter

error(args)

Writes an error message in the developer tool.

  • Parameters
  • args
    • Description: Several arguments and data types are possible.

info(args)

Writes a message in the developer tool.

  • Parameters
  • args
    • Description: Several arguments and data types are possible.

notify(msg)

Writes a notification in the developer tool.

  • Parameters
  • msg
    • Description: Notification
    • Data type: string

off(eventName, handler)

Removes an event listener.

  • Parameters
  • eventName

    • Data type: string
  • handler

    • Data type: function
  • Return: ym.core.EventEmitter

on(eventName, handler)

Adds a listener.

  • Parameters
  • eventName

    • Data type: string
  • handler

    • Data type: function
  • Return: ym.core.EventEmitter

once(eventName, handler)

Adds a listener that reacts only to a single event.

  • Parameters
  • eventName

    • Data type: string
  • handler

    • Data type: function
  • Return: ym.core.EventEmitter

warn(args)

Writes a warning in the developer tool.

  • Parameters
  • args
    • Description: Several arguments and data types are possible