queryChannelsAsState
Performs ChatClient.queryChannels under the hood and returns QueryChannelsState associated with the query. The QueryChannelsState cannot be created before connecting the user therefore, the method returns a StateFlow that emits a null when the user has not been connected yet and the new value every time the user changes.
You can pass option chatEventHandlerFactory parameter which will be associated with this query channels request.
After a reconnect, the channel lists whose returned StateFlow is still referenced and whose coroutineScope is still active are refreshed first, the most recently tracked first. Keep a reference to the returned StateFlow while the list is shown, not only to a flow derived from it, so the list keeps this priority.
Return
A StateFlow object that emits a null when the user has not been connected yet and the new QueryChannelsState when the user changes.
Parameters
The request's parameters combined into QueryChannelsRequest class.
The instance of ChatEventHandlerFactory that will be used to create ChatEventHandler.
The CoroutineScope used for executing the request.