Skip to main content
Version: v2

PureDataObjectFactory Class

PureDataObjectFactory is a bare-bones IFluidDataStoreFactory for use with PureDataObject. Consumers should typically use DataObjectFactory instead unless creating another base data store factory.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/aqueduct/legacy.

For more information about our API support guarantees, see here.

Signature​

export declare class PureDataObjectFactory<TObj extends PureDataObject<I>, I extends DataObjectTypes = DataObjectTypes> implements IFluidDataStoreFactory, Partial<IProvideFluidDataStoreRegistry>

Implements: IFluidDataStoreFactory, Partial<IProvideFluidDataStoreRegistry>

Type Parameters​

ParameterConstraintDefaultDescription
TObjPureDataObject<I>DataObject (concrete type)
IDataObjectTypesDataObjectTypesThe input types for the DataObject

Constructors​

ConstructorAlertsDescription
(constructor)(type, ctor, sharedObjects, optionalProviders, registryEntries, runtimeClass)BetaConstructs a new instance of the PureDataObjectFactory class
(constructor)(props)BetaConstructs a new instance of the PureDataObjectFactory class

Properties​

PropertyAlertsModifiersTypeDescription
IFluidDataStoreFactoryBetareadonlythis
IFluidDataStoreRegistryBetareadonlyIFluidDataStoreRegistry | undefined
registryEntryBetareadonlyNamedFluidDataStoreRegistryEntryConvenience helper to get the data store's/factory's data store registry entry. The return type hides the factory's generics, easing grouping of registry entries that differ only in this way into the same array.
typeBetareadonlystring

Methods​

MethodAlertsReturn TypeDescription
createChildInstance(parentContext, initialState, loadingGroupId)BetaPromise<TObj>Creates a new instance of the object. Uses parent context's registry to build package path to this factory. In other words, registry of context passed in has to contain this factory, with the name that matches this factory's type. It is intended to be used by data store objects that create sub-objects.
createInstance(runtime, initialState, loadingGroupId)BetaPromise<TObj>Creates a new instance of the object. Uses container's registry to find this factory. It's expected that only container owners would use this functionality, as only such developers have knowledge of entries in container registry. The name in this registry for such record should match type of this factory.
createInstanceCore(context, initialState)BetaPromise<TObj>
createInstanceWithDataStore(containerRuntime, initialState, packagePath, loadingGroupId)BetaPromise<[TObj, IDataStore]>Creates a new instance of the object with a datastore which exposes the aliasing api.
createNonRootInstanceCore(containerRuntime, packagePath, initialState, loadingGroupId)BetaPromise<TObj>
createPeerInstance(peerContext, initialState, loadingGroupId)BetaPromise<TObj>Creates a new instance of the object. Uses peer context's registry and its package path to identify this factory. In other words, registry of context passed in has to have this factory. Intended to be used by data store objects that need to create peers (similar) instances of existing objects.
createRootInstance(rootDataStoreId, runtime, initialState)Deprecated, BetaPromise<TObj>Creates a new root instance of the object. Uses container's registry to find this factory. It's expected that only container owners would use this functionality, as only such developers have knowledge of entries in container registry. The name in this registry for such record should match type of this factory.
instantiateDataStore(context, existing)BetaPromise<IFluidDataStoreChannel>

Constructor Details​

(constructor)​

Constructs a new instance of the PureDataObjectFactory class

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

constructor(type: string, ctor: new (props: IDataObjectProps<I>) => TObj, sharedObjects?: readonly IChannelFactory[], optionalProviders?: FluidObjectSymbolProvider<I["OptionalProviders"]>, registryEntries?: NamedFluidDataStoreRegistryEntries, runtimeClass?: typeof FluidDataStoreRuntime);

Remarks​

Use the props object based constructor instead. No new features will be added to this constructor, and it will eventually be deprecated and removed.

Parameters​

ParameterModifiersTypeDescription
typestring
ctornew (props: IDataObjectProps<I>) => TObj
sharedObjectsoptionalreadonly IChannelFactory[]
optionalProvidersoptionalFluidObjectSymbolProvider<I["OptionalProviders"]>
registryEntriesoptionalNamedFluidDataStoreRegistryEntries
runtimeClassoptionaltypeof FluidDataStoreRuntime

(constructor)​

Constructs a new instance of the PureDataObjectFactory class

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

constructor(props: DataObjectFactoryProps<TObj, I>);

Parameters​

ParameterTypeDescription
propsDataObjectFactoryProps<TObj, I>

Property Details​

IFluidDataStoreFactory​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

get IFluidDataStoreFactory(): this;

Type: this

IFluidDataStoreRegistry​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

get IFluidDataStoreRegistry(): IFluidDataStoreRegistry | undefined;

Type: IFluidDataStoreRegistry | undefined

registryEntry​

Convenience helper to get the data store's/factory's data store registry entry. The return type hides the factory's generics, easing grouping of registry entries that differ only in this way into the same array.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

get registryEntry(): NamedFluidDataStoreRegistryEntry;

Type: NamedFluidDataStoreRegistryEntry

type​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

readonly type: string;

Type: string

Method Details​

createChildInstance​

Creates a new instance of the object. Uses parent context's registry to build package path to this factory. In other words, registry of context passed in has to contain this factory, with the name that matches this factory's type. It is intended to be used by data store objects that create sub-objects.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

createChildInstance(parentContext: IFluidDataStoreContext, initialState?: I["InitialState"], loadingGroupId?: string): Promise<TObj>;

Parameters​

ParameterModifiersTypeDescription
parentContextIFluidDataStoreContext
initialStateoptionalI["InitialState"]The initial state to provide to the created data store.
loadingGroupIdoptionalstringNOT production ready, EXPERIMENTAL, please read README. The service needs to support this feature, does not work for most services

Returns​

an object created by this factory. Data store and objects created are not attached to container. They get attached only when a handle to one of them is attached to already attached objects.

Return type: Promise<TObj>

createInstance​

Creates a new instance of the object. Uses container's registry to find this factory. It's expected that only container owners would use this functionality, as only such developers have knowledge of entries in container registry. The name in this registry for such record should match type of this factory.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

createInstance(runtime: IContainerRuntimeBase, initialState?: I["InitialState"], loadingGroupId?: string): Promise<TObj>;

Parameters​

ParameterModifiersTypeDescription
runtimeIContainerRuntimeBasecontainer runtime. It's registry is used to create an object.
initialStateoptionalI["InitialState"]The initial state to provide to the created component.
loadingGroupIdoptionalstringNOT production ready, EXPERIMENTAL, please read README. The service needs to support this feature, does not work for most services

Returns​

an object created by this factory. Data store and objects created are not attached to container. They get attached only when a handle to one of them is attached to already attached objects.

Return type: Promise<TObj>

createInstanceCore​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

protected createInstanceCore(context: IFluidDataStoreContextDetached, initialState?: I["InitialState"]): Promise<TObj>;

Parameters​

ParameterModifiersTypeDescription
contextIFluidDataStoreContextDetached
initialStateoptionalI["InitialState"]

Returns​

Return type: Promise<TObj>

createInstanceWithDataStore​

Creates a new instance of the object with a datastore which exposes the aliasing api.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

createInstanceWithDataStore(containerRuntime: IContainerRuntimeBase, initialState?: I["InitialState"], packagePath?: readonly string[], loadingGroupId?: string): Promise<[TObj, IDataStore]>;

Parameters​

ParameterModifiersTypeDescription
containerRuntimeIContainerRuntimeBase
initialStateoptionalI["InitialState"]The initial state to provide to the created component.
packagePathoptionalreadonly string[]The path to the data store factory to use to create the data object.
loadingGroupIdoptionalstringNOT production ready, EXPERIMENTAL, please read README. The service needs to support this feature, does not work for most services

Returns​

an array containing the object created by this factory and an IDataStore object that enables users to alias the data object. The data object is attached only when it is attached to the handle graph that connects to an aliased object or when the data object is aliased.

Return type: Promise<[TObj, IDataStore]>

createNonRootInstanceCore​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

protected createNonRootInstanceCore(containerRuntime: IContainerRuntimeBase, packagePath: readonly string[], initialState?: I["InitialState"], loadingGroupId?: string): Promise<TObj>;

Parameters​

ParameterModifiersTypeDescription
containerRuntimeIContainerRuntimeBase
packagePathreadonly string[]
initialStateoptionalI["InitialState"]
loadingGroupIdoptionalstring

Returns​

Return type: Promise<TObj>

createPeerInstance​

Creates a new instance of the object. Uses peer context's registry and its package path to identify this factory. In other words, registry of context passed in has to have this factory. Intended to be used by data store objects that need to create peers (similar) instances of existing objects.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

createPeerInstance(peerContext: IFluidDataStoreContext, initialState?: I["InitialState"], loadingGroupId?: string): Promise<TObj>;

Parameters​

ParameterModifiersTypeDescription
peerContextIFluidDataStoreContext
initialStateoptionalI["InitialState"]The initial state to provide to the created component.
loadingGroupIdoptionalstringNOT production ready, EXPERIMENTAL, please read README. The service needs to support this feature, does not work for most services

Returns​

an object created by this factory. Data store and objects created are not attached to container. They get attached only when a handle to one of them is attached to already attached objects.

Return type: Promise<TObj>

createRootInstance​

Creates a new root instance of the object. Uses container's registry to find this factory. It's expected that only container owners would use this functionality, as only such developers have knowledge of entries in container registry. The name in this registry for such record should match type of this factory.

This API is deprecated and will be removed in a future release.

the issue is that it does not allow the customer to decide the conflict resolution policy when an aliasing conflict occurs. Use createInstanceWithDataStore(containerRuntime, initialState, packagePath, loadingGroupId) instead.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

createRootInstance(rootDataStoreId: string, runtime: IContainerRuntime, initialState?: I["InitialState"]): Promise<TObj>;

Parameters​

ParameterModifiersTypeDescription
rootDataStoreIdstring
runtimeIContainerRuntimecontainer runtime. It's registry is used to create an object.
initialStateoptionalI["InitialState"]The initial state to provide to the created component.

Returns​

an object created by this factory. Data store and objects created are not attached to container. They get attached only when a handle to one of them is attached to already attached objects.

Return type: Promise<TObj>

instantiateDataStore​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

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

Parameters​

ParameterTypeDescription
contextIFluidDataStoreContext
existingboolean

Returns​

Return type: Promise<IFluidDataStoreChannel>