Skip to main content

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.

This API is provided as a beta preview and may change without notice.

To use, import via @fluidframework/presence/beta.

For more information about our API support guarantees, see here.

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

PropertyAlertsModifiersTypeDescription
controlsBetareadonlyBroadcastControlsControls for management of sending updates.
eventsBetareadonlyListenable<LatestEvents<T, TRemoteAccessor>>Events for LatestRaw.
localBetaDeepReadonly<JsonDeserialized<T>>Current state for this client. State for this client that will be transmitted to all other connected clients.
presenceBetareadonlyPresenceContaining Presence

Methods

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

Property Details

controls

Controls for management of sending updates.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

readonly controls: BroadcastControls;

Type: BroadcastControls

events

Events for LatestRaw.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

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.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

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

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

readonly presence: Presence;

Type: Presence

Method Details

getRemote

Access to a specific attendee's value.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

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

Parameters

ParameterTypeDescription
attendeeAttendee

Returns

Return type: LatestData<T, TRemoteAccessor>

getRemotes

Iterable access to remote clients' values.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

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

Returns

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

getStateAttendees

Array of Attendees that have provided states.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

getStateAttendees(): Attendee[];

Returns

Return type: Attendee[]