Skip to main content

TreeBranchEvents Interface

Events for TreeBranch.

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

To use, import via @fluidframework/tree/alpha.

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

Signature

/** @sealed */
export interface TreeBranchEvents

Methods

Method Alerts Return Type Description
changed(data, getRevertible) Alpha void Fired when a change is made to the branch. Includes data about the change that is made which listeners can use to filter on changes they care about (e.g. local vs. remote changes).
commitApplied(data, getRevertible) Alpha void

Fired when: - a local commit is applied outside of a transaction - a local transaction is committed

The event is not fired when: - a local commit is applied within a transaction - a remote commit is applied

schemaChanged() Alpha void The stored schema for the document has changed.

Method Details

changed

Fired when a change is made to the branch. Includes data about the change that is made which listeners can use to filter on changes they care about (e.g. local vs. remote changes).

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

To use, import via @fluidframework/tree/alpha.

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

Signature

changed(data: CommitMetadata, getRevertible?: RevertibleFactory): void;

Parameters

Parameter Modifiers Type Description
data CommitMetadata information about the change
getRevertible optional RevertibleFactory a function that allows users to get a revertible for the change. If not provided, this change is not revertible.

commitApplied

Fired when: - a local commit is applied outside of a transaction - a local transaction is committed

The event is not fired when: - a local commit is applied within a transaction - a remote commit is applied

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

To use, import via @fluidframework/tree/alpha.

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

Signature

commitApplied(data: CommitMetadata, getRevertible?: RevertibleFactory): void;

Parameters

Parameter Modifiers Type Description
data CommitMetadata information about the commit that was applied
getRevertible optional RevertibleFactory a function provided that allows users to get a revertible for the commit that was applied. If not provided, this commit is not revertible.

schemaChanged

The stored schema for the document has changed.

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

To use, import via @fluidframework/tree/alpha.

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

Signature

schemaChanged(): void;