Class: EventHandler
Methods
| Name | Description |
|---|---|
:addListener(name,callback) | |
:emit(name,data) |
Method declarations
Method: addListener
lua
function EventHandler:addListener(
name,
callback
) endParameters:
- name (
string) - Name of the event to listen to - callback (
function) - Callback function that receives the event data as the first argument
Method: emit
lua
function EventHandler:emit(
name,
data
) endParameters:
- name (
string) - Name of the event to emit - data (
any) - Data of the event
