off()
#
Available since 2.9.0
Unregisters a listener.
If multiple instances of the same listener are registered, only the first one is removed.
off (event: string, listener: ClusterEventHandler): Promise<void>
Argument | Type | Description |
---|---|---|
event | string | Event name |
listener | ClusterEventHandler | Listener function to remove. |
Usage #
function listener (payload) {
// ... listener code ...
}
app.cluster.on('some:event', listener);
app.cluster.off('some:event', listener);
Edit this page on Github(opens new window)