Constructor
new Events(eventNamesopt, senderopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
eventNames | Array.<string> | <optional> | Event names that could be dispatched. |
sender | * | <optional> |
Methods
(protected) _stamp(name, obj) → {boolean}
Returns true if event callback has stamped.
Parameters:
Name | Type | Description |
---|---|---|
name | Object | Event identifier. |
obj | Object | Event callback. |
Returns:
- Type:
- boolean
clear()
Removes all events.
dispatch(event, …argsopt)
Dispatch event.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
event | EventCallbackHandler | Event instance property that created by event name. | |
args | Object | <optional> <repeatable> | Callback parameters. |
off(name, callback)
Stop listening event name with specified callback function.
Parameters:
Name | Type | Description |
---|---|---|
name | string | Event name. |
callback | EventCallback | | Attached event callback. |
on(name, callback, senderopt, priorityopt)
Attach listener.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name | string | Event name to listen. | ||
callback | EventCallback | Event callback function. | ||
sender | any | <optional> | Event callback function owner. | |
priority | number | <optional> | 0 | Priority of event callback. |
registerNames(eventNames)
Function that creates event object properties that would be dispatched.
Parameters:
Name | Type | Description |
---|---|---|
eventNames | Array.<string> | Specified event names list. |
stopPropagation()
Brakes events propagation.