OptionalonThe 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.
ProtectedemitRegisters 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.