GlobalEmber
events
Subscribe to built-in events (see EventName) and to custom events your scripts declare. Built-in events hand handlers an Event; custom events hand them the fired payload.
Functions
events.on(name: EventName, fn: (event: Event) -> boolean?, options: (boolean | "precise" | EventOptions)?) -> Connection#Connects a handler. Raises for an unknown event name, or past 256 handlers in total. options is an EventOptions, or true/"precise" for a precise handler. Return false (or call e:cancel()) to cancel a cancellable event.
Declares a custom event so it can be connected to and fired. Names are 1 to 64 of letters, digits, _ . : -; at most 256. Raises on a built-in name.