Package 

Class PinnedMessageListViewModel


  • 
    public final class PinnedMessageListViewModel
    extends ViewModel
                        

    ViewModel responsible for providing pinned messages in the channel. Pinned messages are provided in a descending order based on Message.pinnedAt.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final StateFlow<PinnedMessageListState> state
      private final SharedFlow<Unit> errorEvents
    • Method Summary

      Modifier and Type Method Description
      final StateFlow<PinnedMessageListState> getState() The current pinned messages' state.
      final SharedFlow<Unit> getErrorEvents() One shot error events when a query fails.
      final Unit loadMore() Loads more data when requested.
      • Methods inherited from class io.getstream.chat.android.compose.viewmodel.pinned.PinnedMessageListViewModel

        addCloseable, addCloseable, addCloseable, getCloseable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PinnedMessageListViewModel

        PinnedMessageListViewModel(PinnedMessageListController controller)
        Parameters:
        controller - the PinnedMessageListController handling the business logic and the state management for the pinned message list.
    • Method Detail

      • getState

         final StateFlow<PinnedMessageListState> getState()

        The current pinned messages' state.

      • getErrorEvents

         final SharedFlow<Unit> getErrorEvents()

        One shot error events when a query fails.

      • loadMore

         final Unit loadMore()

        Loads more data when requested.

        Does nothing if the end of the list has already been reached or loading is already in progress.