DataObject Class

Packages > @fluidframework/aqueduct > DataObject

DataObject is a base data store that is primed with a root directory and task manager. It ensures that both are 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.

Generics: O - represents a type that will define optional providers that will be injected S - the initial state type that the produced data store may take during creation E - represents events that will be available in the EventForwarder

Signature:

export declare abstract class DataObject<O extends IFluidObject = object, S = undefined, E extends IEvent = IEvent> extends PureDataObject<O, S, E> 

Extends: PureDataObject<O, S, E>

Properties

List of properties for this class
Property Modifiers Type Description
root 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.
taskManager ITaskManager Returns the built-in task manager responsible for scheduling tasks.

Methods

List of methods on this class
Method Modifiers Description
getUninitializedErrorString(item)
initializeInternal(props) Initializes internal objects and calls initialization overrides. Caller is responsible for ensuring this is only invoked once.
request(request)
writeBlob(blob) Temporary implementation of blobs. Currently blobs are stored as properties on root map and we rely on map doing proper snapshot blob partitioning to reuse non-changing big properties. In future blobs would be implemented as first class citizen, using blob storage APIs

Properties

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.

Signature:

protected get root(): ISharedDirectory;

taskManager

Returns the built-in task manager responsible for scheduling tasks.

Signature:

protected get taskManager(): ITaskManager;

Methods

getUninitializedErrorString

Signature:

protected getUninitializedErrorString(item: string): string;

Parameters

List of parameters
Parameter Type Description
item string

Returns:

string

initializeInternal

Initializes internal objects and calls initialization overrides. Caller is responsible for ensuring this is only invoked once.

Signature:

initializeInternal(props?: S): Promise<void>;

Parameters

List of parameters
Parameter Type Description
props S

Returns:

Promise<void>

request

Signature:

request(request: IRequest): Promise<IResponse>;

Parameters

List of parameters
Parameter Type Description
request IRequest

Returns:

Promise<IResponse>

writeBlob

Temporary implementation of blobs. Currently blobs are stored as properties on root map and we rely on map doing proper snapshot blob partitioning to reuse non-changing big properties. In future blobs would be implemented as first class citizen, using blob storage APIs

Signature:

protected writeBlob(blob: string): Promise<IFluidHandle<string>>;

Parameters

List of parameters
Parameter Type Description
blob string

Returns:

Promise<IFluidHandle<string>>