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
Parameter | Constraint | Default | Description |
---|---|---|---|
I | DataObjectTypes | DataObjectTypes | The optional input types used to strongly type the data object |
Properties
Property | 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. |
Methods
Method | Return Type | Description |
---|---|---|
getUninitializedErrorString(item) | string | Generates 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
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.
Signature
initializeInternal(existing: boolean): Promise<void>;
Parameters
Parameter | Type | Description |
---|---|---|
existing | boolean |
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
Parameter | Type | Description |
---|---|---|
request | IRequest |
Returns
Return type: Promise<IResponse>