@tempots/dom

When() function

Renders content conditionally based on a boolean value.

Signature:

When: (condition: Value<boolean>, then: TNode, otherwise?: TNode) => Renderable

Parameters

Parameter

Type

Description

condition

Value

The condition to evaluate

then

TNode

Content to render if condition is true

otherwise

TNode

(Optional) Optional content to render if condition is false

Returns: Renderable

Renderable content