ChannelListViewModel
A state store that represents all the information required to query, filter, show and react to Channel items in a list.
Parameters
Used to connect to the API.
The initial sort used for Channels.
The current data filter. Users can change this state using setFilters to impact which data is shown on the UI.
How many channels we fetch per page.
How many members are fetched for each channel item when loading channels. When null, the server-side default is used.
How many messages are fetched for each channel item when loading channels. When null, the server-side default is used.
The instance of ChatEventHandlerFactory used to create ChatEventHandler.
The debounce time for search queries.
If the draft message feature is enabled.
Sorting for message search results. When null, the server-side default is used.
A flow emitting the current GlobalState.
Constructors
Properties
Currently active channel action, if any. Used to show a dialog for deleting or leaving a channel/conversation.
Gives us the information about the list of channels mutes by the current user.
The current state of the channels screen. It holds all the information required to render the UI.
The state of our network connection - if we're online, connecting or offline.
The current search query.
Currently selected channel, if any. Used to show the bottom drawer information when long tapping on a list item.
Functions
Executes the currently pending activeChannelAction after user confirmation and dismisses it from the UI.
Deletes a channel, after the user chooses the delete ChannelAction. It also removes the activeChannelAction, to remove the dialog from the UI.
Dismisses the activeChannelAction and removes it from the UI.
Executes the given ChannelAction immediately if it doesn't require confirmation, or stores it as activeChannelAction to show a confirmation dialog.
Checks if the channel is muted for the current user.
Checks if a user is blocked by the current user.
Checks if a user is muted by the current user.
Leaves a channel, after the user chooses the leave ChannelAction. It also removes the activeChannelAction, to remove the dialog from the UI.
Mutes a channel.
Pins a channel.
Changes the currently selected channel state. This updates the UI state and allows us to observe the state change.
Allows for the change of filters used for channel queries.
Allows for the change of the query sort used for channel queries.
Changes the current query state. This updates the data flow and triggers another query operation.
Unblocks a user (used for DM channels).
Unmutes a channel.
Unmutes a user (used for DM channels).
Unpins a channel.