queryChannelsAsState

fun ChatClient.queryChannelsAsState(request: QueryChannelsRequest, chatEventHandlerFactory: ChatEventHandlerFactory = ChatEventHandlerFactory(clientState), coroutineScope: CoroutineScope = CoroutineScope(DispatcherProvider.IO)): StateFlow<QueryChannelsState?>

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.

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

request

The request's parameters combined into QueryChannelsRequest class.

chatEventHandlerFactory

The instance of ChatEventHandlerFactory that will be used to create ChatEventHandler.

coroutineScope

The CoroutineScope used for executing the request.

See also