Skip to main content
Version: v1

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​

ConstructorDescription
(constructor)(runtime, channel, context, factoryEntriesMap)Creates a new TestFluidObject.

Static Methods​

MethodReturn TypeDescription
load(runtime, channel, context, factoryEntries, existing)Promise<TestFluidObject>

Properties​

PropertyTypeDescription
channelIFluidDataStoreChannel
contextIFluidDataStoreContext
handleIFluidHandle<this>
IFluidLoadablethis
ITestFluidObjectthis
rootISharedMap
runtimeIFluidDataStoreRuntime

Methods​

MethodReturn TypeDescription
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​

ParameterTypeDescription
runtimeIFluidDataStoreRuntimeThe data store runtime.
channelIFluidDataStoreChannel
contextIFluidDataStoreContextThe data store context.
factoryEntriesMapMap<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​
ParameterDefaultDescription
Tany

Parameters​

ParameterTypeDescription
idstringThe 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​

ParameterTypeDescription
runtimeIFluidDataStoreRuntime
channelIFluidDataStoreChannel
contextIFluidDataStoreContext
factoryEntriesMap<string, IChannelFactory>
existingboolean

Returns​

Return type: Promise<TestFluidObject>

request​

Signature​

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

Parameters​

ParameterTypeDescription
requestIRequest

Returns​

Return type: Promise<IResponse>