pivotick / UIComponent
Abstract Class: UIComponent
Defined in: ui/UIComponent.ts:27
Base class for every UI element. It provides:
- A composite tree. A component owns
children; three of the four lifecycle phases (afterMount/graphReady/destroy) recurse into them automatically.mountis the exception — it needs a per-child slot, soaddChildmounts each child explicitly instead. A parent declares its children viaaddChildand their lifecycle is driven for it. - 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