hosanna-ui-docs - v0.9.0
    Preparing search index...

    NodePool manages reusable SceneGraph nodes for performance and memory efficiency. Implements the INodePool interface.

    Implements

    Index

    Constructors

    Properties

    createdCounts: { [componentType: string]: number } = {}

    Tracks the number of created nodes for each component type.

    holder: ISGNGroup = ...

    The hidden holder group for storing pooled nodes off-screen.

    pool: { [componentType: string]: ISGNNode[] } = {}

    The pool of reusable nodes, keyed by component type.

    Methods

    • Retrieves a node of the specified component type from the pool, or creates a new one if none are available. Optionally applies an initial state to the node.

      Type Parameters

      Parameters

      • componentType: string

        The type of node to retrieve.

      • OptionalinitialState: IStyleDictionary

        Optional initial state to apply to the node.

      Returns T

      The node instance.

    • Prepopulates the pool with a specified number of nodes of the given component type. Nodes are created off-screen and added to the pool.

      Parameters

      • componentType: string

        The type of node to prepopulate.

      • count: number

        The number of nodes to create.

      Returns void