Class: EventChain

bitbucket/util/events. EventChain

new EventChain()

A utility object allowing you to attach handlers to multiple events and detach them all at once.

NOTE: The constructor is not exposed. Use bitbucket/util/events.chain or bitbucket/util/events.chainWith
to obtain an instance.

Source:

Methods

destroy()

Destroy the event chain and detach all listeners. The chain should not be used after calling this method.

Source:

on(eventName, eventListener) → {bitbucket/util/events.EventChain}

Parameters:
Name Type Description
eventName string

The type of event to attach the listener to.

eventListener function

The listener to attach.

Source:
Returns:
Type
bitbucket/util/events.EventChain

once(eventName, eventListener) → {bitbucket/util/events.EventChain}

Handle the first time an event is fired.

Parameters:
Name Type Description
eventName string

The type of event to attach the listener to.

eventListener function

The listener to attach.

Source:
Returns:
Type
bitbucket/util/events.EventChain