Class: core/EventHandler

core/EventHandler

new core/EventHandler()

EventHandler class.
Source:

Extends

Members

ref :Object

Instance reference.
Type:
  • Object
Inherited From:
Source:

Methods

emit(action, event) → {Object}

Triggers event listener of handled action.
Parameters:
Name Type Description
action string Action name.
event Object Event object.
Source:
Returns:
Instance reference.
Type
Object

get(name) → {*}

Returns value of a property.
Parameters:
Name Type Description
name string Property name.
Inherited From:
Source:
Returns:
Value of property.
Type
*

handle(action) → {Object}

Make action ready to use with .on() method.
Parameters:
Name Type Description
action string Action name.
Source:
Returns:
Instance reference.
Type
Object

inc(name, value) → {Object}

Increments given number property as given value.
Parameters:
Name Type Description
name string Property name.
value number Value to increment.
Inherited From:
Source:
Returns:
Instance reference.
Type
Object

isImplementedBy(Interface) → {boolean}

To check is this an instance implemented by given interface.
Parameters:
Name Type Description
Interface Interface Interface
Inherited From:
Source:
Returns:
If it is implemented by given interface.
Type
boolean

isInstanceOf(Class) → {boolean}

To check is this an instance of given class or a class extends given class.
Parameters:
Name Type Description
Class Class Class
Inherited From:
Source:
Returns:
If it is instance of given class.
Type
boolean

off(action, func) → {Object}

Removes event listener from handled action.
Parameters:
Name Type Description
action string Action name.
func function Listener function.
Source:
Returns:
Instance reference.
Type
Object

on(action, func) → {Object}

Adds event listener to handled action.
Parameters:
Name Type Description
action string Action name.
func function Listener function.
Source:
Returns:
Instance reference.
Type
Object

set(name, value) → {Object}

Sets a value to a property.
Parameters:
Name Type Description
name string Property name.
value * Property value.
Inherited From:
Source:
Returns:
Instance reference.
Type
Object

unset(name) → {Object}

Unsets / deletes a property.
Parameters:
Name Type Description
name string Property name.
Inherited From:
Source:
Returns:
Instance reference.
Type
Object