offEvent
Removes an event listener from Dynamic client events. This function unsubscribes a previously registered event listener from the specified Dynamic client event.Usage
Parameters
| Parameter | Type | Description |
|---|---|---|
event | string | The event name to remove the listener from. |
listener | Function | The callback function to remove. |
client | DynamicClient (optional) | The Dynamic client instance. Only required when using multiple clients. |
Returns
void
Important Notes
- The
listenerparameter must be the exact same function reference that was used when adding the listener - Anonymous functions cannot be removed with
offEvent- store a reference to the function first
Examples
Basic event cleanup
Using returned cleanup function from onEvent
Related functions
- onEvent - Subscribe to events