Open jpnurmi opened 2 years ago
It would be better if we could make these stream work regardless of when they are connected. I guess that would involve making a StreamController
for each object, then using addStream()
when the DBus object appears to pass the events.
Would it make sense to output a warning, for example, if
NetworkManagerClient.propertiesChanged
or other similar properties are accessed beforeNetworkManagerClient.connect()
has completed?vs.
The above example may look silly because the order makes perfect sense and the fix is just a matter of swapping two lines. However, when the NM client is injected into a widget tree and lazily initialized when needed, things may get confusing when property change notifications go quietly missing when accidentally setting up subscriptions at construction time.
When the code is changed to something like this, the problem is no longer that obvious.