Skip to main content
Version: v1

RootDataObject Class

The entry-point/root collaborative object of the Fluid Container. This class abstracts the dynamic code required to build a Fluid Container into a static representation for end customers.

Signature

export declare class RootDataObject extends DataObject<{
InitialState: RootDataObjectProps;
}>

Extends: DataObject<{ InitialState: RootDataObjectProps

Properties

PropertyTypeDescription
initialObjectsLoadableObjectRecordProvides a record of the initial objects defined on creation. See initializingFirstTime(props)
InitialStateRootDataObjectProps

Methods

MethodReturn TypeDescription
create(objectClass)Promise<T>Dynamically creates a new detached collaborative object (DDS/DataObject).
hasInitialized()Promise<void>

Every time an instance is initialized, loads all of the initial objects in the root directory so they can be accessed immediately.

See hasInitialized()

initializingFirstTime(props)Promise<void>

The first time this object is initialized, creates each object identified in initialObjects and stores them as unique values in the root directory.

See initializingFirstTime(props)

Property Details

initialObjects

Provides a record of the initial objects defined on creation. See initializingFirstTime(props)

Signature

get initialObjects(): LoadableObjectRecord;

Type: LoadableObjectRecord

InitialState

Signature

InitialState: RootDataObjectProps;

Type: RootDataObjectProps

Method Details

create

Dynamically creates a new detached collaborative object (DDS/DataObject).

Signature

create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>;
Type Parameters
ParameterConstraintDescription
TIFluidLoadable

Parameters

ParameterTypeDescription
objectClassLoadableObjectClass<T>Type of the collaborative object to be created.

Returns

Return type: Promise<T>

hasInitialized

Every time an instance is initialized, loads all of the initial objects in the root directory so they can be accessed immediately.

See hasInitialized()

Signature

protected hasInitialized(): Promise<void>;

Returns

Return type: Promise<void>

initializingFirstTime

The first time this object is initialized, creates each object identified in initialObjects and stores them as unique values in the root directory.

See initializingFirstTime(props)

Signature

protected initializingFirstTime(props: RootDataObjectProps): Promise<void>;

Parameters

ParameterTypeDescription
propsRootDataObjectProps

Returns

Return type: Promise<void>