Optional
onThe error handling function to call when an error occurs.
The start function called when all listeners are started.
The stop function called when all listeners are stopped.
Protected
emitRegisters a callback to be called when the state changes. If a callback was previously registered, it will be replaced with the new one.
The function to call with the new state value.
A Listener class that manages event listeners for state changes.