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

Property Type Description
initialObjects LoadableObjectRecord Provides a record of the initial objects defined on creation. See initializingFirstTime(props)

Methods

Method Return Type Description
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

Method Details

create

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

Signature

create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>;
Type Parameters
Parameter Constraint Description
T IFluidLoadable

Parameters

Parameter Type Description
objectClass LoadableObjectClass<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

Parameter Type Description
props RootDataObjectProps

Returns

Return type: Promise<void>