Skip to main content

IFluidDataStoreContext Interface

Represents the context for the data store. It is used by the data store runtime to get information and call functionality to the container.

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

To use, import via @fluidframework/runtime-definitions/legacy.

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

Signature

export interface IFluidDataStoreContext extends IFluidParentContext

Extends: IFluidParentContext

Properties

Property Alerts Modifiers Type Description
baseSnapshot Alpha readonly ISnapshotTree | undefined
createProps Deprecated, Alpha optional, readonly any
id Alpha readonly string
isLocalDataStore Alpha readonly boolean A data store created by a client, is a local data store for that client. Also, when a detached container loads from a snapshot, all the data stores are treated as local data stores because at that stage the container still doesn't exists in storage and so the data store couldn't have been created by any other client. Value of this never changes even after the data store is attached. As implementer of data store runtime, you can use this property to check that this data store belongs to this client and hence implement any scenario based on that.
packagePath Alpha readonly readonly string[] The package path of the data store as per the package factory.

Methods

Method Alerts Modifiers Return Type Description
createChildDataStore(childFactory) Alpha optional ReturnType<Exclude<T["createDataStore"], undefined>>

Synchronously creates a detached child data store.

The createChildDataStore method allows for the synchronous creation of a detached child data store. This is particularly useful in scenarios where immediate availability of the child data store is required, such as during the initialization of a parent data store, or when creation is in response to synchronous user input.

In order for this function to succeed: 1. The parent data store's factory must also be an IFluidDataStoreRegistry. 2. The parent data store's registry must include the same instance as the provided child factory. 3. The parent data store's registry must synchronously provide the child factory via the getSync method. 4. The child factory must implement the createDataStore method.

These invariants ensure that the child data store can also be created by a remote client running the same code as this client.

getBaseGCDetails() Deprecated, Alpha Promise<IGarbageCollectionDetailsBase>

Property Details

baseSnapshot

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 baseSnapshot: ISnapshotTree | undefined;

Type: ISnapshotTree | undefined

createProps

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

0.16 Issue #1635, #3631

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 createProps?: any;

Type: any

id

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 id: string;

Type: string

isLocalDataStore

A data store created by a client, is a local data store for that client. Also, when a detached container loads from a snapshot, all the data stores are treated as local data stores because at that stage the container still doesn't exists in storage and so the data store couldn't have been created by any other client. Value of this never changes even after the data store is attached. As implementer of data store runtime, you can use this property to check that this data store belongs to this client and hence implement any scenario based on that.

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 isLocalDataStore: boolean;

Type: boolean

packagePath

The package path of the data store as per the package 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

readonly packagePath: readonly string[];

Type: readonly string[]

Method Details

createChildDataStore

Synchronously creates a detached child data store.

The createChildDataStore method allows for the synchronous creation of a detached child data store. This is particularly useful in scenarios where immediate availability of the child data store is required, such as during the initialization of a parent data store, or when creation is in response to synchronous user input.

In order for this function to succeed: 1. The parent data store's factory must also be an IFluidDataStoreRegistry. 2. The parent data store's registry must include the same instance as the provided child factory. 3. The parent data store's registry must synchronously provide the child factory via the getSync method. 4. The child factory must implement the createDataStore method.

These invariants ensure that the child data store can also be created by a remote client running the same code as this client.

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

createChildDataStore?<T extends IFluidDataStoreFactory>(childFactory: T): ReturnType<Exclude<T["createDataStore"], undefined>>;
Type Parameters
Parameter Constraint Description
T IFluidDataStoreFactory

Parameters

Parameter Type Description
childFactory T The factory of the data store to be created.

Returns

The created data store channel.

Return type: ReturnType<Exclude<T["createDataStore"], undefined>>

getBaseGCDetails

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

The functionality to get base GC details has been moved to summarizer node.

Returns the GC details in the initial summary of this data store. This is used to initialize the data store and its children with the GC details from the previous summary.

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

getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;

Returns

Return type: Promise<IGarbageCollectionDetailsBase>