ISharedObject Interface
Packages > @fluidframework/shared-object-base > ISharedObject
Base interface for shared objects from which other interfaces derive. Implemented by SharedObject
Signature:
export interface ISharedObject<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends IProvideSharedObject, IChannel, IEventProvider<TEvent>
Extends: IProvideSharedObject, IChannel, IEventProvider<TEvent>
Methods
Method | Description |
---|---|
bindToContext() | Binds the given shared object to its containing data store runtime, causing it to attach once the runtime attaches. |
connect(services) | Enables the channel to send and receive ops. |
isAttached() | Returns whether the given shared object is attached to storage. |
snapshot() | Gets a form of the object that can be serialized. |
Methods
bindToContext
Binds the given shared object to its containing data store runtime, causing it to attach once the runtime attaches.
Signature:
bindToContext(): void;
Returns:
void
connect
Enables the channel to send and receive ops.
Signature:
connect(services: IChannelServices): void;
Parameters
Parameter | Type | Description |
---|---|---|
services | IChannelServices | Services to connect to |
Returns:
void
isAttached
Returns whether the given shared object is attached to storage.
Signature:
isAttached(): boolean;
Returns:
boolean
True if the given shared object is attached
snapshot
Gets a form of the object that can be serialized.
Signature:
snapshot(): ITree;
Returns:
A tree representing the snapshot of the shared object