Skip to main content
Version: v2

Latest Interface

State that provides the latest known value from this client to others and read access to their values. All participant clients must provide a value.

Sealed

This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.

Signature​

/** @sealed */
export interface Latest<T, TRemoteAccessor extends ValueAccessor<T> = ProxiedValueAccessor<T>>

Type Parameters​

ParameterConstraintDefaultDescription
T
TRemoteAccessorValueAccessor<T>ProxiedValueAccessor<T>

Remarks​

Create using StateFactory.latest registered to StatesWorkspace.

Properties​

PropertyModifiersTypeDescription
controlsreadonlyBroadcastControlsControls for management of sending updates.
eventsreadonlyListenable<LatestEvents<T, TRemoteAccessor>>Events for LatestRaw.
localDeepReadonly<JsonDeserialized<T>>Current state for this client. State for this client that will be transmitted to all other connected clients.
presencereadonlyPresenceContaining Presence

Methods​

MethodReturn TypeDescription
getRemote(attendee)LatestData<T, TRemoteAccessor>Access to a specific attendee's value.
getRemotes()IterableIterator<LatestClientData<T, TRemoteAccessor>>Iterable access to remote clients' values.
getStateAttendees()Attendee[]Array of Attendees that have provided states.

Property Details​

controls​

Controls for management of sending updates.

Signature​

readonly controls: BroadcastControls;

Type: BroadcastControls

events​

Events for LatestRaw.

Signature​

readonly events: Listenable<LatestEvents<T, TRemoteAccessor>>;

Type: Listenable<LatestEvents<T, TRemoteAccessor>>

local​

Current state for this client. State for this client that will be transmitted to all other connected clients.

Signature​

get local(): DeepReadonly<JsonDeserialized<T>>;

set local(value: JsonSerializable<T>);

Type: DeepReadonly<JsonDeserialized<T>>

Remarks​

Manager assumes ownership of the value and its references. Make a deep clone before setting, if needed. No comparison is done to detect changes; all sets are transmitted.

presence​

Containing Presence

Signature​

readonly presence: Presence;

Type: Presence

Method Details​

getRemote​

Access to a specific attendee's value.

Signature​

getRemote(attendee: Attendee): LatestData<T, TRemoteAccessor>;

Parameters​

ParameterTypeDescription
attendeeAttendee

Returns​

Return type: LatestData<T, TRemoteAccessor>

getRemotes​

Iterable access to remote clients' values.

Signature​

getRemotes(): IterableIterator<LatestClientData<T, TRemoteAccessor>>;

Returns​

Return type: IterableIterator<LatestClientData<T, TRemoteAccessor>>

getStateAttendees​

Array of Attendees that have provided states.

Signature​

getStateAttendees(): Attendee[];

Returns​

Return type: Attendee[]