DataStoreCreator Interface
A context which has a registry and can create data stores using it.
To use, import via fluid-framework/alpha.
For more information about our API support guarantees, see here.
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 DataStoreCreator
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| createDataStore(kind) | Alpha | Promise<T> | Create a new detached data store T which can be attached to the FluidContainer. by adding a handle to a data store or shared object which is already attached to the FluidContainer. |
Method Details
createDataStore
Create a new detached data store T which can be attached to the FluidContainer. by adding a handle to a data store or shared object which is already attached to the FluidContainer.
For more information about our API support guarantees, see here.
Signature
createDataStore<T>(kind: DataStoreKey<T>): Promise<T>;
Type Parameters
| Parameter | Description |
|---|---|
| T | type implemented by the data store to expose in the result, as defined by kind. |
Remarks
kind will be looked up in the Registry used to create or load this DataStoreCreator. It is up to that registry to decide how it handles unknown types, for example by throwing an exception or returning a placeholder.
Parameters
| Parameter | Type | Description |
|---|---|---|
| kind | DataStoreKey<T> |
Returns
Return type: Promise<T>