LocalChangeMetadata Interface
Information about a change that has been applied by the local client.
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 LocalChangeMetadata extends CommitMetadata
Extends: CommitMetadata
Properties
| Property | Alerts | Modifiers | Type | Description |
|---|---|---|---|---|
| isLocal | Alpha | readonly | true | Whether the change was made on the local machine/client or received from a remote client. |
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| getChange() | Alpha | JsonCompatibleReadOnly | Returns a serializable object that encodes the change. |
| getRevertible(onDisposed) | Alpha | RevertibleAlpha | undefined | Returns an object (a "revertible") that can be used to revert the change that produced this event. |
Property Details
isLocal
Whether the change was made on the local machine/client or received from a remote client.
For more information about our API support guarantees, see here.
Signature
readonly isLocal: true;
Type: true
Method Details
getChange
Returns a serializable object that encodes the change.
For more information about our API support guarantees, see here.
Signature
getChange(): JsonCompatibleReadOnly;
Remarks
This is only available for local changes. This change object can be applied to another branch in the same state as the one which generated it. The change object must be applied to a SharedTree with the same IdCompressor session ID as it was created from.
Returns
Return type: JsonCompatibleReadOnly
getRevertible
Returns an object (a "revertible") that can be used to revert the change that produced this event.
For more information about our API support guarantees, see here.
Signature
getRevertible(onDisposed?: (revertible: RevertibleAlpha) => void): RevertibleAlpha | undefined;
Remarks
This is only available for local changes. If the change is not revertible (for example, it was a change to the application schema), then this will return undefined. Revertibles should be disposed when they are no longer needed.
Parameters
| Parameter | Modifiers | Type | Description |
|---|---|---|---|
| onDisposed | optional | (revertible: RevertibleAlpha) => void | A callback that will be invoked when the Revertible is disposed. This happens when the Revertible is disposed manually or when the TreeView that the Revertible belongs to is disposed - whichever happens first. This is typically used to clean up any resources associated with the Revertible in the host application. |
Returns
Return type: RevertibleAlpha | undefined
Error Handling
Throws an error if called outside the scope of the changed event that provided it.