Private
createdTracks the number of created nodes for each component type.
Private
holderThe hidden holder group for storing pooled nodes off-screen.
Private
poolThe pool of reusable nodes, keyed by component type.
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.
The type of node to retrieve.
Optional
initialState: IStyleDictionaryOptional initial state to apply to the node.
The node instance.
Returns counts of total, available, and created nodes by component type.
An object containing node counts.
Prepopulates the pool with a specified number of nodes of the given component type. Nodes are created off-screen and added to the pool.
The type of node to prepopulate.
The number of nodes to create.
Releases a node back into the pool for reuse. Removes the node from its parent and appends it to the holder group.
The node to release.
NodePool manages reusable SceneGraph nodes for performance and memory efficiency. Implements the INodePool interface.