stopListening
Stops listening for registered event handlers.
obj.stopListening( [bindTarget], [event,] handler]] )
.stopListening unbinds on event handlers registered through
listenTo. All event handlers
that match the arguments will be unbound. For example:
// Unbinds all .listenTo registered handlers
obj.stopListening()
// Unbinds all .listenTo registered with `bindTarget`
obj.stopListening(bindTarget)
// Unbinds all .listenTo registered with `bindTarget`, `event`
obj.stopListening(bindTarget, event)
// Unbinds the handler registered with `bindTarget`, `event`, `handler`
obj.stopListening(bindTarget, event, handler)
.listenTo is often returned by can-component's connectedCallback lifecyle hook.
Parameters
- bindTarget
{Object}:The object we will stop listening to event on. If
bindTargetis not provided, the observable.stopListeningwas called on will be thebindTarget. - event
{String}:The name of the event to listen for.
- handler
{function}:The handler that will be executed to handle the event.
Returns
{Object}:
this