Skip to main content

LatestMap Interface

State that provides a Map of latest known values from this client to others and read access to their values. Entries in the map may vary over time and by client, but all values are expected to be of the same type, which may be a union type.

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 LatestMap<T, Keys extends string | number = string | number, TRemoteAccessor extends ValueAccessor<T> = ProxiedValueAccessor<T>>

Type Parameters

ParameterConstraintDefaultDescription
T
Keysstring | numberstring | number
TRemoteAccessorValueAccessor<T>ProxiedValueAccessor<T>

Remarks

Create using StateFactory.latestMap registered to StatesWorkspace.

Properties

PropertyAlertsModifiersTypeDescription
controlsBetareadonlyBroadcastControlsControls for management of sending updates.
eventsBetareadonlyListenable<LatestMapEvents<T, Keys, TRemoteAccessor>>Events for LatestMap.
localBetareadonlyStateMap<Keys, T>Current value map for this client.
presenceBetareadonlyPresenceContaining Presence

Methods

MethodAlertsReturn TypeDescription
getRemote(attendee)BetaReadonlyMap<Keys, LatestData<T, TRemoteAccessor>>Access to a specific client's map of values.
getRemotes()BetaIterableIterator<LatestMapClientData<T, Keys, TRemoteAccessor>>Iterable access to remote clients' map of 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 LatestMap.

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<LatestMapEvents<T, Keys, TRemoteAccessor>>;

Type: Listenable<LatestMapEvents<T, Keys, TRemoteAccessor>>

local

Current value map for this client.

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 local: StateMap<Keys, T>;

Type: StateMap<Keys, T>

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 client's map of 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

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

Parameters

ParameterTypeDescription
attendeeAttendee

Returns

Return type: ReadonlyMap<Keys, LatestData<T, TRemoteAccessor>>

getRemotes

Iterable access to remote clients' map of 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<LatestMapClientData<T, Keys, TRemoteAccessor>>;

Returns

Return type: IterableIterator<LatestMapClientData<T, Keys, 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[]