A type of component.
Readonly
componentA component instance.
It is an error accessing this property before the component is created, e.g. from inside of component constructor or component instantiation event receiver. A whenReady callback can be used to work this around.
Readonly
componentComponent class constructor.
Readonly
connectedWhether the component's element is connected.
This becomes true
right before whenConnected event is sent.
Readonly
contentComponent content root.
This is a shorthand for requesting a content root from component context.
Readonly
elementCustom element constructed for the component according to its type.
E.g. HTMLElement
instance.
Readonly
mountedWhether the component is mounted to element.
Readonly
onceAn OnEvent
sender of component's element connection event.
The registered receiver is called when component's element is connected. E.g. when custom element's
connectedCallback()
method is called.
If connected already the receiver is called immediately.
Readonly
onceAn OnEvent
sender of component readiness event.
The component is constructed shortly after context. So the component may not exist when requested inside component constructor or component instantiation event receiver. The registered receiver will be notified when the component is constructed.
If the component is constructed already, the receiver will be notified immediately.
Readonly
onceAn OnEvent
sender of component settlement event.
The registered receiver is called when component is settled. If settled already the receiver is called immediately.
Readonly
readAn AfterEvent
keeper of component status.
Sends this context instance each time the component status changes.
Readonly
readyWhether the component is ready.
Set to true
when component is available.
Readonly
settledWhether the component is settled.
Component settlement happens:
It is guaranteed that component settlement won't happen inside custom element's constructor. So the settlement event may be used e.g. to start DOM manipulations, as it is prohibited inside custom element constructor.
This becomes true
right before whenSettled event is sent.
Readonly
supplyAn event supply that disposes component and its context when cut off.
Unmounts the mounted component.
For custom element the component may be reconstructed when element is connected to document or settled again.
Readonly
updateUpdates component's state.
This is a shorthand for invoking a component state updater .
A type of changed value.
Changed value key.
New value.
Previous value.
Readonly
whenAn OnEvent
sender of single component's element connection event.
The registered receiver is called when component's element is connected. E.g. when custom element's
connectedCallback()
method is called.
If connected already the receiver is called immediately.
In contrast to onceConnected, cuts off the event supply after sending the first event.
Readonly
whenAn OnEvent
sender of single component readiness event.
The component is constructed shortly after context. So the component may not exist when requested inside component constructor or component instantiation event receiver. The registered receiver will be notified when the component is constructed.
If the component is constructed already, the receiver will be notified immediately.
In contrast to onceReady, cuts off the event supply after sending the first event.
Readonly
whenAn OnEvent
sender of single component settlement event.
The registered receiver is called when component is settled. If settled already the receiver is called immediately.
In contrast to onceSettled, cuts off the event supply after sending the first event.
Dispatches an event to component element.
Dispatches using a component event dispatcher available in this context.
An event to dispatch.
Obtains value of the given context entry.
Either context entry value, or a fallback one.
Requested context value type.
Context entry to obtain the value of.
Optional
request: WithoutFallback<TValue>Context value request with fallback specified.
Obtains value of the given context entry, or returns a non-nullable fallback.
Either context entry value, or a fallback one.
Requested context value type.
Context entry to obtain the value of.
Context value request with fallback specified.
Obtains value of the given context entry, or returns a nullable fallback.
Either context entry value, or a fallback one.
CxReferenceError - If the target entry
has no value and fallback one is not provided.
Requested context value type.
Context entry to obtain the value of.
Optional
request: CxRequest<TValue>Context value request.
Returns DOM event producer for the given event type.
Retrieves an event producer from component event dispatcher available in this context.
A producer of DOM event events of the given type.
DOM event type.
An event type to listen for.
Settles component.
Calling this method has no effect if component is settled already, when component is not ready yet, or custom element's constructor is not exited.
Calling this method may trigger DOM manipulations (the latter is prohibited inside custom element's constructor). This may be desired for rendering optimizations. E.g. to render element's content before adding it to document.
This method is called automatically when mounting component to element.
Generated using TypeDoc
Component context.
Passed to component constructor as its only parameter.
Extends
ContextValues
interface. The values are provided by corresponding providers registered with perComponent and perComponent methods.