Browse API 1 documentation
grove.off()
Remove one previously registered event listener.
Mango 3.1+View Markdown
Signature
ts
grove.off(type: string, callback: Function): void
Availability
All packaged runtimes. No capability required.
Parameters
| Parameter | Required | Description |
|---|---|---|
type |
Yes | The exact event name passed to on. |
callback |
Yes | The same function object passed to on. An equivalent new arrow function does not match. |
Return value
Returns undefined.
Behavior and errors
Removes the first matching subscription. Missing event names or callbacks are a no-op. It does not clear the retained event payload or cancel a callback already running. Delivery iterates a snapshot of listeners, so removal does not alter that in-progress iteration.
Example
js
function onLifecycle(event) {
console.debug('Lifecycle:', event.state)
}
grove.on('lifecycle', onLifecycle)
grove.off('lifecycle', onLifecycle)
See grove.on().