DataStoreOptions Interface
Options which define how to construct a particular DataStoreKind.
To use, import via fluid-framework/alpha.
For more information about our API support guarantees, see here.
This type is "input," meaning that code outside of the library defining it should not read from it. Future versions of this type may add optional members or make typing of members more general.
Signature
export interface DataStoreOptions<in out TRoot extends IFluidLoadable, out TOutput>
Type Parameters
| Parameter | Constraint | Description |
|---|---|---|
| TRoot | IFluidLoadable | |
| TOutput |
Remarks
Use defineDataStore(options) to create a DataStoreKind from these options.
Properties
| Property | Alerts | Modifiers | Type | Description |
|---|---|---|---|---|
| registry | Alpha | readonly | SharedObjectRegistry | The registry of shared object kinds (including other data stores) that can be loaded or created within this data store. TODO: actually allow this to contain data stores. |
| type | Alpha | readonly | string | The type identifier for the data object factory. |
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| instantiateFirstTime(rootCreator, context) | Alpha | Promise<TRoot> | Create the initial content of the data store, and return the root shared object. |
| view(root, context) | Alpha | Promise<TOutput> | Construct a view of the data store's root shared object. |
Property Details
registry
The registry of shared object kinds (including other data stores) that can be loaded or created within this data store.
TODO: actually allow this to contain data stores.
For more information about our API support guarantees, see here.
Signature
readonly registry: SharedObjectRegistry;
Type: SharedObjectRegistry
type
The type identifier for the data object factory.
For more information about our API support guarantees, see here.
Signature
readonly type: string;
Type: string
Remarks
Persisted identifier which specifies which DataStoreKind to use when loading it.
Method Details
instantiateFirstTime
Create the initial content of the data store, and return the root shared object.
For more information about our API support guarantees, see here.
Signature
instantiateFirstTime(rootCreator: SharedObjectCreator<TRoot>, context: DataStoreContext): Promise<TRoot>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| rootCreator | SharedObjectCreator<TRoot> | |
| context | DataStoreContext |
Returns
Return type: Promise<TRoot>
view
Construct a view of the data store's root shared object.
For more information about our API support guarantees, see here.
Signature
view(root: TRoot, context: DataStoreContext): Promise<TOutput>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| root | TRoot | The root shared object of the data store, created by instantiateFirstTime (though possibly created by another client and loaded by this one). |
| context | DataStoreContext | A DataStoreContext that can be used to create additional shared objects. |
Returns
Return type: Promise<TOutput>