Options
All
  • Public
  • Public/Protected
  • All
Menu

The IVNode interface represents a virtual node. Through this interface, callers can perform most common actions that are available on every type of virtual node. Each type of virtual node also implements a more specific interface through which the specific capabilities of the node type are available.

Hierarchy

Index

Properties

Optional Readonly creator

creator?: null | IComponent<{}, {}>

Component that created this node.

Optional Readonly depth

depth?: number

Level of nesting at which the node resides relative to the root node.

Readonly index

index: number

Zero-based index of this node in the parent's list of sub-nodes. This is zero for the root nodes that don't have parents.

Optional Readonly name

name?: string

Gets node's display name. This is used mostly for tracing and error reporting. The name can change during the lifetime of the virtual node; for example, it can reflect an "id" property of an element.

Optional Readonly parent

parent?: null | IVNode

Gets node's parent. This is undefined for the top-level (root) nodes.

Optional Readonly subNodes

subNodes?: null | IVNode[]

List of sub-nodes.

Methods

getService

  • Retrieves the value for a service with the given ID registered by a closest ancestor component or the default value if none of the ancestor components registered a service with this ID. This method doesn't establish a subscription and only reflects the current state.

    Type parameters

    • K: "ErrorBoundary"

    Parameters

    • id: K

      Unique service identifier

    • Optional defaultValue: IServiceDefinitions[K]

      Default value to return if no publish service is found.

    • Optional useSelf: boolean

      Flag indicating whether the search for the service should start from the virtual node that calls this method. The default value is false meaning the search starts from the parent virtual node.

    Returns IServiceDefinitions[K]

    Current value of the service or default value if no published service is found.