SharedSummaryBlock Class
Implementation of a shared summary block. It does not generate any ops. It is only part of the summary. Data should be set in this object in response to a remote op.
Signature
export declare class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock
Extends: SharedObject
Implements: ISharedSummaryBlock
Constructors
Constructor | Description |
---|---|
(constructor)(id, runtime, attributes) | Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will be provided. |
Static Methods
Method | Return Type | Description |
---|---|---|
create(runtime, id) | SharedSummaryBlock | Create a new shared summary block |
getFactory() | IChannelFactory | Get a factory for SharedSummaryBlock to register with the data store. |
Methods
Method | Return Type | Description |
---|---|---|
applyStashedOp() | void | |
get(key) | Jsonable<T> | Retrieves the given key from the map. |
loadCore(storage) | Promise<void> | |
onDisconnect() | void | |
processCore(message, local) | void | |
set(key, value) | void | Sets the value stored at key to the provided value. |
summarizeCore(serializer) | ISummaryTreeWithStats | Gets a form of the object that can be serialized. |
Constructor Details
(constructor)
Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will be provided.
Signature
constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
Parameters
Parameter | Type | Description |
---|---|---|
id | string | optional name of the shared summary block. |
runtime | IFluidDataStoreRuntime | data store runtime thee object belongs to. |
attributes | IChannelAttributes | The attributes for the object. |
Method Details
applyStashedOp
Signature
protected applyStashedOp(): void;
create
Create a new shared summary block
Signature
static create(runtime: IFluidDataStoreRuntime, id?: string): SharedSummaryBlock;
Parameters
Parameter | Modifiers | Type | Description |
---|---|---|---|
runtime | IFluidDataStoreRuntime | data store runtime the new shared summary block belongs to. | |
id | optional | string | optional name of the shared summary block. |
Returns
newly created shared summary block (but not attached yet).
Return type: SharedSummaryBlock
get
Retrieves the given key from the map.
Signature
get<T>(key: string): Jsonable<T>;
Type Parameters
Parameter | Description |
---|---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
key | string | Key to retrieve from. |
Returns
The stored value, or undefined if the key is not set.
Return type: Jsonable<T>
getFactory
Get a factory for SharedSummaryBlock to register with the data store.
Signature
static getFactory(): IChannelFactory;
Returns
a factory that creates and loads SharedSummaryBlock.
Return type: IChannelFactory
loadCore
Signature
protected loadCore(storage: IChannelStorageService): Promise<void>;
Parameters
Parameter | Type | Description |
---|---|---|
storage | IChannelStorageService |
Returns
Return type: Promise<void>
onDisconnect
Signature
protected onDisconnect(): void;
processCore
Signature
protected processCore(message: ISequencedDocumentMessage, local: boolean): void;
Parameters
Parameter | Type | Description |
---|---|---|
message | ISequencedDocumentMessage | |
local | boolean |
set
Sets the value stored at key to the provided value.
Signature
set<T>(key: string, value: Jsonable<T>): void;
Type Parameters
Parameter | Description |
---|---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
key | string | Key to set at. |
value | Jsonable<T> | Jsonable type value to set. |
summarizeCore
Gets a form of the object that can be serialized.
Signature
protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
Parameters
Parameter | Type | Description |
---|---|---|
serializer | IFluidSerializer |
Returns
A tree representing the snapshot of the shared object.
Return type: ISummaryTreeWithStats