ACtl.off
Removes event listener functions from one or more event types.
ACtl.off([eventTypes,][listener]) eventTypes Type: string Default: undefined
One or more event types (separated by a space character) from which to remove the listener function
specified by listener. Refer to ACtl.on for the list of valid event types.
If this argument is omitted, the listener function will be removed from all event types.
listener Type: Function Default: undefined
A listener function to remove (previously added with ACtl.on).
If omitted, all listener functions will be removed from the event types specified by eventTypes.
Returns Type: Promise Resolves to: Object
Returns immediately. The Promise will resolve once the listener functions have been removed.
Throws Type: string
Error description if eventTypes contains an invalid event type or if listener is not a function.
Examples
Remove listeners by event type and by function.
ACtl.on('tabOpen tabActivate', function listener1(event){ /* ... */ }) ;
ACtl.on('tabLoadEnd', function(event){ /* ... */ }) ;
//Remove `listener1` from all event types
await ACtl.off(listener1) ;
//Remove all listener functions from the 'tabLoadEnd' event type
await ACtl.off('tabLoadEnd') ;
Remove all listener functions from all event types.
//With no arguments, everything is removed
await ACtl.off() ;