Skip to main content
Version: v1

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.

Signature

export declare abstract class DataObject<I extends DataObjectTypes = DataObjectTypes> extends PureDataObject<I>

Extends: PureDataObject

Type Parameters

ParameterConstraintDefaultDescription
IDataObjectTypesDataObjectTypesThe optional input types used to strongly type the data object

Properties

PropertyTypeDescription
rootISharedDirectoryThe 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

MethodReturn TypeDescription
getUninitializedErrorString(item)stringGenerates an error string indicating an item is uninitialized.
initializeInternal(existing)Promise<void>Initializes internal objects and calls initialization overrides. Caller is responsible for ensuring this is only invoked once.
request(request)Promise<IResponse>Return this object if someone requests it directly We will return this object in two scenarios: 1. the request url is a "/" 2. the request url is empty

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.

Signature

protected get root(): ISharedDirectory;

Type: ISharedDirectory

Method Details

getUninitializedErrorString

Generates an error string indicating an item is uninitialized.

Signature

protected getUninitializedErrorString(item: string): string;

Parameters

ParameterTypeDescription
itemstringThe 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.

Signature

initializeInternal(existing: boolean): Promise<void>;

Parameters

ParameterTypeDescription
existingboolean

Returns

Return type: Promise<void>

request

Return this object if someone requests it directly We will return this object in two scenarios: 1. the request url is a "/" 2. the request url is empty

Signature

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

Parameters

ParameterTypeDescription
requestIRequest

Returns

Return type: Promise<IResponse>