Callbacks
Execute logic when a listener library loads.
Define a listenerLoaded
callback function within a listener library:
Callbacks functions can be asynchronous. When a library has asynchronous callbacks, the end user can await the promise returned by listener.load
.
The import in this example has no effect on compiled output. It is purely for accessing types.
Callback arguments
Callbacks receive two arguments, a listener id (lid
) and a listener event object:
Property | Description |
| Listener library instance |
| Listener instance |
| Existing (already loaded) listener libraries |
| Library instances passed into the |
| Options passed into the |
Available callbacks
Callback | Timing |
| Once this listener library is ready |
| Once any listener library is ready |
| Before |
| Before |
| After |
| After |
| Before |
Last updated