Wijmo uses an event system similar to .NET. Classes define events as fields, and developers can subscribe to them using addHandler and unsubscribe using removeHandler.
Event handlers always receive two parameters:
sender: The object that raised the event.args: An object containing the event parameters.
Wijmo follows a pattern where every event has a corresponding on[EventName] method. Derived classes can override this method to execute code before or after the base class raises the event, or to suppress the event entirely by omitting the call to the base class implementation.
// Example: Overriding onValueChanged to perform processing around the event
onValueChanged(e: EventArgs) {
// execute some code before the event fires
console.log('about to fire valueChanged');
// call base class to fire the event
super.onValueChanged(e);
// execute some code after the event fired
console.log('valueChanged event just fired');
}