on method
API to register for notification.
It is mandatory to pass event and callback parameters.
event
- Event used for the subscription. A valid event is mandatory.
callback
- EventCallback function registered to receive events emitted from the publisher. A valid callback function is mandatory.
Implementation
Listener<T> on(T event, EventCallback callback) =>
listen(event, callback, false);