Closed rekire closed 4 months ago
Hi @rekire 👋
ConnectionState
is not an enum because the Disconnected
state contains properties like the error, stackTrace, and code which are not applicable in other states. If there was an error stream then you'd need to handle listening to two streams which seems like it would negatively impact the developer experience. In addition, imo being disconnected is part of the connection state.
Closing for now but if you feel strongly about this please provide some additional context regarding what use-case you have and how these changes would improve your usage and I'm happy to take a closer look, thanks!
Description
I was checking the documentation regarding the connection state (and I expected a stream btw). I noticed that the ConnectionState is an abstract class. It seems that there is a special handling for Disconnected. I think that should be some kind of error stream instead of part of an state.
Requirements