Automerge Repo - v2.5.2-alpha.5
    Preparing search index...
    type UsePresenceResult<State extends PresenceState> = {
        localState: State | undefined;
        peerStates: PeerStateView<State>;
        start: (config?: Partial<PresenceConfig<State>>) => void;
        stop: () => void;
        update: <Channel extends keyof State>(
            channel: Channel,
            value: State[Channel],
        ) => void;
    }

    Type Parameters

    Index

    Properties

    localState: State | undefined

    Our own presence state, as last set by update or the initial value.

    peerStates: PeerStateView<State>

    Presence view of our peers.

    start: (config?: Partial<PresenceConfig<State>>) => void

    Resume presence broadcasting and listening to peer presence.

    Note that this only needs to be called after stop has been called: usePresence starts running immediately.

    stop: () => void

    Stop broadcasting presence state and listening to peer presence.

    update: <Channel extends keyof State>(
        channel: Channel,
        value: State[Channel],
    ) => void

    Update our presence state for the given channel and broadcast it to our peers.