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.
How many messages are fetched for each channel item when loading channels.
The instance of ChatEventHandlerFactory used to create ChatEventHandler.
The debounce time for search queries.
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.
Currently selected channel, if any. Used to show the bottom drawer information when long tapping on a list item.
Functions
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.
Checks if the channel is muted for 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.
Clears the active action if we've chosen Cancel, otherwise, stores the selected action as the currently active action, in activeChannelAction.
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.
Unmutes a channel.
Unpins a channel.