UIElement Docs Version 0.13.1

🔗 Function: component()

component<P>(name, init, setup): Component<P>

Defined in: src/component.ts:279

Define a component with its states and setup function (connectedCallback)

🔗 Type Parameters

🔗 P

P extends ComponentProps

🔗 Parameters

🔗 name

string

name of the custom element

🔗 init

{ [K in string | number | symbol]: Initializer<P[K], Component<P>> } = ...

signals of the component

🔗 setup

(host, select) => FxFunction<P, Component<P>>[]

setup function to be called in connectedCallback(), may return cleanup function to be called in disconnectedCallback()

🔗 Returns

Component<P>

  • constructor function for the custom element

🔗 Since

0.12.0