SixL client API / events / EventMpConstructor
Interface: EventMpConstructor
The constructor mp.Event.
Constructors
Constructor
new EventMpConstructor<K>(eventName,callback):EventMp
Registers a handler at once (the same as mp.events.add(eventName, callback)) and returns a handle to remove it.
Parameters
eventName
K
The client event's name (see IClientEvents).
callback
The handler.
Returns
The handle; destroy() on it removes the handler.
Example
const ev = new mp.Event('render', () => { });
Constructor
new EventMpConstructor(eventName,callback):EventMp
Registers a handler for any event name.
Parameters
eventName
string
The event name.
callback
(...args) => void
The handler.
Returns
The handle; destroy() on it removes the handler.
Example
const ev = new mp.Event('shop:opened', (count) => { });