Automerge Repo - v2.5.2-alpha.0
    Preparing search index...
    • This hook encapsulates ephemeral state communication for a specific doc handle. It tracks caller-provided local state and broadcasts that state to all peers. It sends periodic heartbeats when there are no state updates.

      It also tracks ephemeral state broadcast by peers and forces a re-render when the state of a peer changes.

      It cleans up (stops sending heartbeats and processing ephemeral messages) when it unmounts.

      It is implemented using Presence.

      Type Parameters

      • State extends Record<string, any>

      Parameters

      • config: UsePresenceConfig<State>

        see UsePresenceConfig. Note that initialState only determines the initial value. Updates to this param will not trigger a re-render of the hook.

      Returns UsePresenceResult<State>

      see UsePresenceResult