OOjs/Events

is a mixin that allows event handlers to be attached, called when events occur, and detached.

Basic usage
The simplest way to attach and detach event handlers is by using the  and   methods of every OOjs and OOUI object.

Using with objects
When working with methods, you can use the  and   methods. lets you wire up multiple events at once using less code, and  knows how to unplug them all.

Emitting events
Attached event handlers are called with arguments provided to the  method.