Skip to main content

TreeViewEvents Interface

Events for TreeView. \

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 TreeViewEvents

Methods

MethodReturn TypeDescription
commitApplied(data, getRevertible)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
rootChanged()void

Raised whenever root is invalidated.

This includes changes to the document schema. It also includes changes to the field containing the root such as setting or clearing an optional root or changing which node is the root. This does NOT include changes to the content (fields/children) of the root node: for that case subscribe to events on the root node.

schemaChanged()voidThe stored schema for the document has changed. This may affect the compatibility between the view schema and the stored schema, and thus the ability to use the view.

Method Details

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

Signature

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

Parameters

ParameterModifiersTypeDescription
dataCommitMetadatainformation about the commit that was applied
getRevertibleoptionalRevertibleFactorya function provided that allows users to get a revertible for the commit that was applied. If not provided, this commit is not revertible.

rootChanged

Raised whenever root is invalidated.

This includes changes to the document schema. It also includes changes to the field containing the root such as setting or clearing an optional root or changing which node is the root. This does NOT include changes to the content (fields/children) of the root node: for that case subscribe to events on the root node.

Signature

rootChanged(): void;

schemaChanged

The stored schema for the document has changed. This may affect the compatibility between the view schema and the stored schema, and thus the ability to use the view.

Signature

schemaChanged(): void;

Remarks

This event implies that the old root is no longer valid, but applications need not handle that separately: rootChanged() will be fired after this event.