off
Description
Remove a listener previously registered with on.
Pass the same function reference you registered — an inline function or a
different reference will not match, and the listener stays registered.
binaryWindow.off(eventName, listener);
Parameters
| Name | Type | Description |
|---|---|---|
eventName | string | Name of the event the listener was registered for. |
listener | function | The same listener reference passed to on. |
Removing a listener that was never registered is a no-op. See Events for the full list of events.
Returns
Type: void
Examples
function handleAdd(sash) {
console.log('pane added', sash.id);
}
binaryWindow.on('pane-add', handleAdd);
binaryWindow.off('pane-add', handleAdd); // stop listening
See also
- on — register a listener
- useWindow hook — reach
offfrom any React component