The entrypoint for all actions that relate presence of other peers known by the current peer, either directly or through other peers.

You don't create one directly but can access it from a particular Ditto instance via its presence property.

Properties

Accessors

Methods

Properties

ditto: Ditto

The Ditto instance this object belongs to.

Accessors

  • get graph(): PresenceGraph
  • Returns the current presence graph capturing all known peers and connections between them.

    Returns PresenceGraph

Methods

  • Request information about Ditto peers in range of this device.

    This method returns an observer which should be held as long as updates are required. A newly registered observer will have a peers update delivered to it immediately. From then on it will be invoked repeatedly when Ditto devices come and go, or the active connections to them change.

    Parameters

    • didChangeHandler: ((presenceGraph) => void)
        • (presenceGraph): void
        • Parameters

          Returns void

    Returns Observer