onStateChanged property

void onStateChanged=(void cb(ConnectionState))

Set state change listener for this connection. The given callback will be invoked when the state of this connection changes.

Implementation

// no need for this to be public,
// but needed in the actual implementations
set onStateChanged(void Function(ConnectionState) cb);