Api > EventHandler > Add()
EventHandler.Add(function function)⚓︎
Adds a new function as a handler. The value must be a function type to properly attach it.
Parameters:⚓︎
Name | Type | Description |
---|---|---|
function | function | The function which will called when event invoked |
Usage⚓︎
---@type EventHandler
local eventhandler;
---@type function
local function;
eventhandler.Add(function)
Example⚓︎
local function myFunction()
Debug.Log("Hello There");
end
local event = EventHandler();
event.Add(myFunction);