ChannelListViewModel

constructor(filter: FilterObject? = null, sort: QuerySorter<Channel> = DEFAULT_SORT, limit: Int = DEFAULT_CHANNEL_LIMIT, messageLimit: Int = DEFAULT_MESSAGE_LIMIT, memberLimit: Int = DEFAULT_MEMBER_LIMIT, isDraftMessagesEnabled: Boolean, chatEventHandlerFactory: ChatEventHandlerFactory = ChatEventHandlerFactory(), chatClient: ChatClient = ChatClient.instance(), globalState: Flow<GlobalState> = chatClient.globalStateFlow)

Parameters

filter

Filter for querying channels, should never be empty.

sort

Defines the ordering of the channels.

limit

The maximum number of channels to fetch.

messageLimit

The number of messages to fetch for each channel.

memberLimit

The number of members to fetch per channel.

isDraftMessagesEnabled

Enables or disables draft messages.

chatEventHandlerFactory

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

chatClient

Entry point for all low-level operations.

globalState

A flow emitting the current GlobalState.


constructor(filter: FilterObject? = null, sort: QuerySorter<Channel> = DEFAULT_SORT, limit: Int = DEFAULT_CHANNEL_LIMIT, messageLimit: Int = DEFAULT_MESSAGE_LIMIT, memberLimit: Int = DEFAULT_MEMBER_LIMIT, isDraftMessagesEnabled: Boolean = true, chatEventHandlerFactory: ChatEventHandlerFactory = ChatEventHandlerFactory(), chatClient: ChatClient = ChatClient.instance(), globalState: GlobalState = chatClient.globalState)

Deprecated

Use the constructor which accepts a Flow<GlobalState> for the globalState instead.

ViewModel class for ChannelListView. Responsible for keeping the channels list up to date. Can be bound to the view using ChannelListViewModel.bindView function.

Parameters

filter

Filter for querying channels, should never be empty.

sort

Defines the ordering of the channels.

limit

The maximum number of channels to fetch.

messageLimit

The number of messages to fetch for each channel.

memberLimit

The number of members to fetch per channel.

isDraftMessagesEnabled

Enables or disables draft messages.

chatEventHandlerFactory

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

chatClient

Entry point for all low-level operations.

globalState

The current GlobalState.