Skip to main content

LocalChangeMetadata Interface

Information about a change that has been applied by the local client.

This API is provided as an alpha preview and may change without notice.

To use, import via fluid-framework/alpha.

For more information about our API support guarantees, see here.

Sealed

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

PropertyAlertsModifiersTypeDescription
isLocalAlphareadonlytrueWhether the change was made on the local machine/client or received from a remote client.

Methods

MethodAlertsReturn TypeDescription
getChange()AlphaJsonCompatibleReadOnlyReturns a serializable object that encodes the change.
getRevertible(onDisposed)AlphaRevertibleAlpha | undefinedReturns 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.

This API is provided as an alpha preview and may change without notice.

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.

This API is provided as an alpha preview and may change without notice.

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.

This API is provided as an alpha preview and may change without notice.

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

ParameterModifiersTypeDescription
onDisposedoptional(revertible: RevertibleAlpha) => voidA 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.