DataObject Class
DataObject is a base data store that is primed with a root directory. It ensures that it is created and ready before you can access it.
Having a single root directory allows for easier development. Instead of creating and registering channels with the runtime any new DDS that is set on the root will automatically be registered.
To use, import via @fluidframework/aqueduct/legacy.
For more information about our API support guarantees, see here.
Signature
export declare abstract class DataObject<I extends DataObjectTypes = DataObjectTypes> extends PureDataObject<I>
Extends: PureDataObject<I>
Type Parameters
| Parameter | Constraint | Default | Description |
|---|---|---|---|
| I | DataObjectTypes | DataObjectTypes | The optional input types used to strongly type the data object |
Properties
| Property | Alerts | Modifiers | Type | Description |
|---|---|---|---|---|
| root | Beta |
readonly |
ISharedDirectory | The root directory will either be ready or will return an error. If an error is thrown the root has not been correctly created/set. |
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| getUninitializedErrorString(item) | Beta |
string | Generates an error string indicating an item is uninitialized. |
| initializeInternal(existing) | Beta |
Promise<void> | Initializes internal objects and calls initialization overrides. Caller is responsible for ensuring this is only invoked once. |
Property Details
root
The root directory will either be ready or will return an error. If an error is thrown the root has not been correctly created/set.
For more information about our API support guarantees, see here.
Signature
protected get root(): ISharedDirectory;
Type: ISharedDirectory
Method Details
getUninitializedErrorString
Generates an error string indicating an item is uninitialized.
For more information about our API support guarantees, see here.
Signature
protected getUninitializedErrorString(item: string): string;
Parameters
| Parameter | Type | Description |
|---|---|---|
| item | string | The name of the item that was uninitialized. |
Returns
Return type: string
initializeInternal
Initializes internal objects and calls initialization overrides. Caller is responsible for ensuring this is only invoked once.
For more information about our API support guarantees, see here.
Signature
initializeInternal(existing: boolean): Promise<void>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| existing | boolean |
Returns
Return type: Promise<void>