Methods
# static listen(name, listener)
Subscribe to one kind of event
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the event |
listener |
function
|
Listener function for the event. The detail of the event contains the information passed |
# static remove(name, listener)
Unsubscribe to one kind of event with a exact listener
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the event |
listener |
function
|
Listener function to remove |
# static trigger(name, detailopt)
Trigger one event
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
string
|
Name of the event |
||
detail |
object
|
<optional> |
{} | Detail of the event |