Skip to main content

ContainerSchema Interface

Declares the Fluid objects that will be available in the Container.

Signature

export interface ContainerSchema

Remarks

It includes both the instances of objects that are initially available upon Container creation, as well as the types of objects that may be dynamically created throughout the lifetime of the Container.

Properties

Property Modifiers Type Description
dynamicObjectTypes optional, readonly readonly SharedObjectKind[] Loadable objects that can be created after the initial Container creation.
initialObjects readonly Record<string, SharedObjectKind> Defines loadable objects that will be created when the Container is first created.

Property Details

dynamicObjectTypes

Loadable objects that can be created after the initial Container creation.

Signature

readonly dynamicObjectTypes?: readonly SharedObjectKind[];

Type: readonly SharedObjectKind[]

Remarks

Types defined in initialObjects will always be available and are not required to be provided here.

For best practice it's recommended to define all the dynamic types you create even if they are included via initialObjects.

initialObjects

Defines loadable objects that will be created when the Container is first created.

Signature

readonly initialObjects: Record<string, SharedObjectKind>;

Type: Record<string, SharedObjectKind>

Remarks

It uses the key as the id and the value as the loadable object to create.

Example

In the example below two objects will be created when the Container is first created. One with id "map1" that will return a SharedMap and the other with id "pair1" that will return a KeyValueDataObject.

{
map1: SharedMap,
pair1: KeyValueDataObject,
}