TreeBranchEvents Interface
Events for TreeBranch.
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 TreeBranchEvents extends Omit<TreeViewEvents, "commitApplied">
Extends: Omit<TreeViewEvents, "commitApplied">
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 |
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).
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
changed(data: CommitMetadata, getRevertible?: RevertibleAlphaFactory): void;
Parameters
Parameter | Modifiers | Type | Description |
---|---|---|---|
data | CommitMetadata | information about the change | |
getRevertible | optional | RevertibleAlphaFactory | 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
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
commitApplied(data: CommitMetadata, getRevertible?: RevertibleAlphaFactory): void;
Parameters
Parameter | Modifiers | Type | Description |
---|---|---|---|
data | CommitMetadata | information about the commit that was applied | |
getRevertible | optional | RevertibleAlphaFactory | a function provided that allows users to get a revertible for the commit that was applied. If not provided, this commit is not revertible. |