-
Notifications
You must be signed in to change notification settings - Fork 1
Event unbind
DizzasTeR edited this page Nov 1, 2020
·
1 revision
Un-Binds a function handler from an event.
bool Event.unbind(string eventName, function handler)
- string eventName - The event to trigger
- function handler - The function handler to remove
NOTE: Anonymous handlers cannot be unbound
bool - true if the event was successfully unbound, false if something went wrong.
function myOnServerStart()
Logger.info("Server started!")
end
Event.bind("onServerInit", myOnServerStart) -- bind a handler
-- Lets remove it now
Event.unbind("onServerInit", myOnServerStart)
Event.bind("onServerInit", function() -- bind an anonymous function
Logger.info("The server init event was triggered!")
end)