TestFluidObject Class
A test Fluid object that will create a shared object for each key-value pair in the factoryEntries passed to load. The shared objects can be retrieved by passing the key of the entry to getSharedObject. It exposes the IFluidDataStoreContext and IFluidDataStoreRuntime.
Signature
export declare class TestFluidObject implements ITestFluidObject
Implements: ITestFluidObject
Constructors
Constructor | Description |
---|---|
(constructor)(runtime, channel, context, factoryEntriesMap) | Creates a new TestFluidObject. |
Static Methods
Method | Return Type | Description |
---|---|---|
load(runtime, channel, context, factoryEntries, existing) | Promise<TestFluidObject> |
Properties
Property | Type | Description |
---|---|---|
channel | IFluidDataStoreChannel | |
context | IFluidDataStoreContext | |
handle | IFluidHandle<this> | |
IFluidLoadable | this | |
ITestFluidObject | this | |
root | ISharedMap | |
runtime | IFluidDataStoreRuntime |
Methods
Method | Return Type | Description |
---|---|---|
getSharedObject(id) | Promise<T> | Retrieves a shared object with the given id. |
request(request) | Promise<IResponse> |
Constructor Details
(constructor)
Creates a new TestFluidObject.
Signature
constructor(runtime: IFluidDataStoreRuntime, channel: IFluidDataStoreChannel, context: IFluidDataStoreContext, factoryEntriesMap: Map<string, IChannelFactory>);
Parameters
Parameter | Type | Description |
---|---|---|
runtime | IFluidDataStoreRuntime | The data store runtime. |
channel | IFluidDataStoreChannel | |
context | IFluidDataStoreContext | The data store context. |
factoryEntriesMap | Map<string, IChannelFactory> |
Property Details
channel
Signature
readonly channel: IFluidDataStoreChannel;
Type: IFluidDataStoreChannel
context
Signature
readonly context: IFluidDataStoreContext;
Type: IFluidDataStoreContext
handle
Signature
get handle(): IFluidHandle<this>;
Type: IFluidHandle<this>
IFluidLoadable
Signature
get IFluidLoadable(): this;
Type: this
ITestFluidObject
Signature
get ITestFluidObject(): this;
Type: this
root
Signature
root: ISharedMap;
Type: ISharedMap
runtime
Signature
readonly runtime: IFluidDataStoreRuntime;
Type: IFluidDataStoreRuntime
Method Details
getSharedObject
Retrieves a shared object with the given id.
Signature
getSharedObject<T = any>(id: string): Promise<T>;
Type Parameters
Parameter | Default | Description |
---|---|---|
T | any |
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The id of the shared object to retrieve. |
Returns
Return type: Promise<T>
load
Signature
static load(runtime: IFluidDataStoreRuntime, channel: IFluidDataStoreChannel, context: IFluidDataStoreContext, factoryEntries: Map<string, IChannelFactory>, existing: boolean): Promise<TestFluidObject>;
Parameters
Parameter | Type | Description |
---|---|---|
runtime | IFluidDataStoreRuntime | |
channel | IFluidDataStoreChannel | |
context | IFluidDataStoreContext | |
factoryEntries | Map<string, IChannelFactory> | |
existing | boolean |
Returns
Return type: Promise<TestFluidObject>
request
Signature
request(request: IRequest): Promise<IResponse>;
Parameters
Parameter | Type | Description |
---|---|---|
request | IRequest |
Returns
Return type: Promise<IResponse>