Automerge Repo - v2.6.0-alpha.2
    Preparing search index...

    Type Alias GetStatesOpts<State, SummaryState>

    type GetStatesOpts<State extends PresenceState, SummaryState> = {
        groupingFn?: (state: PeerState<State>) => PropertyKey;
        summaryFn?: (states: PeerState<State>[]) => SummaryState;
    }

    Type Parameters

    Index

    Properties

    groupingFn?: (state: PeerState<State>) => PropertyKey

    Function to derive a grouping key from a peer state. This can be used to group peers and consider presence activity by an arbitrary attribute of the presence state (e.g., user or device) rather than by peer.

    This is useful when a user has multiple devices, or multiple peers (e.g., tabs) on a single device.

    Type Declaration

      • (state: PeerState<State>): PropertyKey
      • Parameters

        Returns PropertyKey

        key that should be used to consolidate activity from that peer

    summaryFn?: (states: PeerState<State>[]) => SummaryState

    Function to summarize the presence activity from several different peers in a group.

    Type Declaration