Endpoints consist of a hierarchy of parts. This class manages the current state of a single endpoint.

You can interact with endpoints using an Agent created with Endpoint.agentFor. Agents are stateless and designed for quick instantiation so you can create them as needed then discard.

Most often direct access to Agent is transparent as Matter.js acquires an agent as necessary for Behavior interactions.

Type Parameters

Hierarchy (view full)

Constructors

Accessors

Methods

  • Update state values. This is a patch operation; it only modifies properties in values.

    values is an object with a Behavior.id as the key and state values as sub-objects.

    Input values must adhere to the Behavior.schema of the target Behavior. If not, set will throw an error.

    This is a transactional operation. An error results in no change. The endpoint will wait for exclusive access before applying changes.

    Parameters

    Returns Promise<void>