Skip to content

pivotick v3.0.0


pivotick / UIComponent

Abstract Class: UIComponent ​

Defined in: ui/UIComponent.ts:27

Base class for every UI element. It provides:

  1. A composite tree. A component owns children; three of the four lifecycle phases (afterMount / graphReady / destroy) recurse into them automatically. mount is the exception — it needs a per-child slot, so addChild mounts each child explicitly instead. A parent declares its children via addChild and their lifecycle is driven for it.
  2. A disposable registry. Anything registered via track / listen (event unsubscribes, DOM listeners, timers) is torn down on destroy.

Subclasses override the on* hooks rather than the lifecycle methods themselves, so the recursion and teardown always run.

Extended by ​

Constructors ​

Constructor ​

new UIComponent(uiManager): UIComponent

Defined in: ui/UIComponent.ts:32

Parameters ​

uiManager ​

UIManager

Returns ​

UIComponent

Methods ​

afterMount() ​

afterMount(): void

Defined in: ui/UIComponent.ts:54

Returns ​

void


destroy() ​

destroy(): void

Defined in: ui/UIComponent.ts:64

Returns ​

void


graphReady() ​

graphReady(): void

Defined in: ui/UIComponent.ts:59

Returns ​

void


mount() ​

mount(container?): void

Defined in: ui/UIComponent.ts:50

Parameters ​

container? ​

HTMLElement

Returns ​

void