Skip to main content
off(eventName, callback) Removes a previously registered event listener. Follows the Node.js EventEmitter interface. The callback must be the same function reference passed to on() or once(). Returns this, so calls can be chained.

Parameters

eventName
DailyEvent
required
The event name to unsubscribe from.
callback
function
required
The exact function reference that was registered with on() or once().

Return value

Returns this (the DailyCall instance) for chaining.

Example

function handleParticipantJoined({ participant }) {
  console.log('Joined:', participant.user_name);
}

call.on('participant-joined', handleParticipantJoined);

// Later, remove the listener
call.off('participant-joined', handleParticipantJoined);

See also

Methods

Guides