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
Constructor | Description |
---|---|
(constructor)(factoryEntries, type) | Creates a new TestFluidObjectFactory. |
Properties
Property | Type | Description |
---|---|---|
IFluidDataStoreFactory | this | |
type | string |
Methods
Method | Return Type | Description |
---|---|---|
instantiateDataStore(context, existing) | Promise<FluidDataStoreRuntime> |
Constructor Details
(constructor)
Creates a new TestFluidObjectFactory.
Signature
constructor(factoryEntries: ChannelFactoryRegistry, type?: string);
Parameters
Parameter | Modifiers | Type | Description |
---|---|---|---|
factoryEntries | ChannelFactoryRegistry | A 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. | |
type | optional | string |
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
Parameter | Type | Description |
---|---|---|
context | IFluidDataStoreContext | |
existing | boolean |
Returns
Return type: Promise<FluidDataStoreRuntime>