Skip to content

moxie.core.EventTarget

Davit Barbakadze edited this page Aug 5, 2017 · 2 revisions

Important! This page is auto-generated from the comments in the source files. All changes will be overwritten! If you are looking to contribute, modify the comment in the corresponding source file instead.

Module: moxie.core.EventTarget

Table of Contents

Constructor

Parent object for all event dispatching components and objects

Properties

Unique id of the event dispatcher, usually overriden by children

Methods

Can be called from within a child in order to acquire uniqie id in automated manner

Register a handler to a specific event dispatched by the object

Arguments

  • type String
    Type or basically a name of the event to subscribe to
  • fn Function
    Callback function that will be called when event happens
  • [priority=0] Number
    Priority of the event handler - handlers with higher priorities will be called first
  • [scope=this] Object
    A scope to invoke event handler in

Check if any handlers were registered to the specified event

Arguments

  • [type] String
    Type or basically a name of the event to check

Unregister the handler from the event, or if former was not specified - unregister all handlers

Arguments

  • type String
    Type or basically a name of the event
  • [fn] Function
    Handler to unregister

Remove all event handlers from the object

Dispatch the event

Arguments

  • Type String/Object
    of event or event object to dispatch
  • [...] Mixed
    Variable number of arguments to be passed to a handlers

Register a handler to the event type that will run only once

Arguments

  • type String
    Type or basically a name of the event to subscribe to
  • fn Function
    Callback function that will be called when event happens
  • [priority=0] Number
    Priority of the event handler - handlers with higher priorities will be called first
  • [scope=this] Object
    A scope to invoke event handler in