Implements a basic version of the Event interface, allowing for messages and data to be passed between child/parent.
Methods
# addEventListener(event_name, callback)
Add an event listener
Parameters:
Name | Type | Description |
---|---|---|
event_name |
string | Name of the event |
callback |
EventCallback | Event callback to fire |
# createEvent(event_name, options) → {Event}
Helper for creating a new event, supporting IE9
Parameters:
Name | Type | Description |
---|---|---|
event_name |
string | Name of the event |
options |
EventOptions | Event options |
Event
# dispatchEvent(event, data) → {boolean}
Include support for passing data along event
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | the Event object to dispatch |
data |
any | Data to be passed to the callback |
boolean
# removeEventListener(event_name, callback) → {EventCallback|null}
Remove an event listener
Parameters:
Name | Type | Description |
---|---|---|
event_name |
string | Name of the event |
callback |
EventCallback | The event callback to remove |
EventCallback
|
null