Skip to main content

FluidContainer Interface

A Fluid container.

This API is provided as an alpha preview and may change without notice.

To use, import via fluid-framework/alpha.

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

Sealed

This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.

Signature

/** @sealed */
export interface FluidContainer<TData = unknown> extends DataStoreCreator, ErasedBaseType<readonly ["FluidContainer", TData]>

Extends: DataStoreCreator, ErasedBaseType<readonly ["FluidContainer", TData]>

Type Parameters

ParameterDefaultDescription
TDataunknownThe type of the container's root data store, exposed via data.

Remarks

A document which can be stored to or loaded from a Fluid service using a ServiceClient.

Properties

PropertyAlertsModifiersTypeDescription
dataAlphareadonlyTDataThe root data store of the container.
idAlphaoptional, readonlystring | undefinedThe unique identifier for this container within its service.

Methods

MethodAlertsReturn TypeDescription
close()AlphavoidClose the container, stopping all networking and cancelling runtime timers.

Property Details

data

The root data store of the container.

This API is provided as an alpha preview and may change without notice.

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

Signature

readonly data: TData;

Type: TData

Remarks

The type of the root data store is defined by the DataStoreKind used to create the container.

id

The unique identifier for this container within its service.

This API is provided as an alpha preview and may change without notice.

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

Signature

readonly id?: string | undefined;

Type: string | undefined

Remarks

undefined if the container has not yet been attached to a service. This can be used to load another instance of this container from the service using loadContainer(id, root).

Method Details

close

Close the container, stopping all networking and cancelling runtime timers.

This API is provided as an alpha preview and may change without notice.

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

Signature

close(): void;

Remarks

After calling close(), the container's data can still be read but no further operations can be sent.