ContainerSchema Interface
Packages > fluid-framework > ContainerSchema
The ContainerSchema declares the Fluid objects that will be available in the container. 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.
Signature:
export interface ContainerSchema
Properties
Property | Type | Description |
---|---|---|
dynamicObjectTypes | LoadableObjectClass | Dynamic objects are Loadable objects that can be created after the initial Container creation.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 | LoadableObjectClassRecord | initialObjects defines loadable objects that will be created when the Container is first created. It uses the key as the id and the value as the loadable object to create.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,
}
```
|
Events
dynamicObjectTypes
Dynamic objects are Loadable objects that can be created after the initial Container creation.
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.
Signature:
dynamicObjectTypes?: LoadableObjectClass<any>[];
initialObjects
initialObjects defines loadable objects that will be created when the Container is first created. It uses the key as the id and the value as the loadable object to create.
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,
}
Signature:
initialObjects: LoadableObjectClassRecord;