Provides an interface for handling events as callbacks via on, once and off.
Methods
off(key[, handler]) :ININ.Addins.IEventHandler
Unbinds the optionally specified handler from the event key.
Parameters
| Name | Type | Description |
|---|---|---|
| key | String |
The event key. |
| handler | function |
The callback handler. |
Returns
This ININ.Addins.IEventHandler instance.
on(key, handler) :ININ.Addins.IEventHandler
Binds the specified event key to the callback that can be emitted 1 or more times.
Parameters
| Name | Type | Description |
|---|---|---|
| key | String |
The event key. |
| handler | function |
The callback handler. |
Returns
This ININ.Addins.IEventHandler instance.
once(key, handler) :ININ.Addins.IEventHandler
Binds the specified event key to the callback that can be emitted only once, then removed.
Parameters
| Name | Type | Description |
|---|---|---|
| key | String |
The event key. |
| handler | function |
The callback handler. |
Returns
This ININ.Addins.IEventHandler instance.