EventHelper
A convenience object that simplifies the common pattern of attaching event listeners to several events, then removing all those listeners at once later, for example, in a destroy method.
const helper = new EventHelper();
helper.add(someObject.event, listener1, this);
helper.add(otherObject.event, listener2, this);
// later...
helper.removeAll();
Content copied to clipboard