ISyncedState Interface

Packages > @fluidframework/react > ISyncedState

The interface for interacting with the synced state that is stored on a SyncedDataObject

Signature:

export interface ISyncedState 

Properties

List of properties of this interface
Property Type Description
addValueChangedListener (callback: (changed: IDirectoryValueChanged, local: boolean) => void) => void Add a listener to the synced state using a provided callback
get (key: string) => T | undefined Get values from the synced state for a syncedStateId as key
set (key: string, value: any) => void Set values on the synced state for a syncedStateId as key

Events

addValueChangedListener

Add a listener to the synced state using a provided callback

Signature:

addValueChangedListener: (callback: (changed: IDirectoryValueChanged, local: boolean) => void) => void;

get

Get values from the synced state for a syncedStateId as key

Signature:

get: <T>(key: string) => T | undefined;

set

Set values on the synced state for a syncedStateId as key

Signature:

set: (key: string, value: any) => void;