Skip to main content
Version: v1

TestFluidObjectFactory Class

Creates a factory for a TestFluidObject with the given object factory entries. It creates a data store runtime with the object factories in the entry list. All the entries with an id other than undefined are passed to the Fluid object so that it can create a shared object for each.

For example, the following will create a Fluid object that creates and loads a SharedString and SharedDirectory. It will add SparseMatrix to the data store's factory so that it can be created later. new TestFluidObjectFactory([ [ "sharedString", SharedString.getFactory() ], [ "sharedDirectory", SharedDirectory.getFactory() ], [ undefined, SparseMatrix.getFactory() ], ]);

The SharedString and SharedDirectory can be retrieved via getSharedObject() on the TestFluidObject as follows: sharedString = testFluidObject.getSharedObject("sharedString"); sharedDir = testFluidObject.getSharedObject("sharedDirectory");

Signature

export declare class TestFluidObjectFactory implements IFluidDataStoreFactory

Implements: IFluidDataStoreFactory

Constructors

ConstructorDescription
(constructor)(factoryEntries, type)Creates a new TestFluidObjectFactory.

Properties

PropertyTypeDescription
IFluidDataStoreFactorythis
typestring

Methods

MethodReturn TypeDescription
instantiateDataStore(context, existing)Promise<FluidDataStoreRuntime>

Constructor Details

(constructor)

Creates a new TestFluidObjectFactory.

Signature

constructor(factoryEntries: ChannelFactoryRegistry, type?: string);

Parameters

ParameterModifiersTypeDescription
factoryEntriesChannelFactoryRegistryA list of id to IChannelFactory mapping. It creates a data store runtime with each IChannelFactory. Entries with string ids are passed to the Fluid object so that it can create a shared object for it.
typeoptionalstring

Property Details

IFluidDataStoreFactory

Signature

get IFluidDataStoreFactory(): this;

Type: this

type

Signature

readonly type: string;

Type: string

Method Details

instantiateDataStore

Signature

instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise<FluidDataStoreRuntime>;

Parameters

ParameterTypeDescription
contextIFluidDataStoreContext
existingboolean

Returns

Return type: Promise<FluidDataStoreRuntime>