@tempots/dom

LazyWhen() function

Lazily renders content based on a boolean condition.

Signature:

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

Parameters

Parameter

Type

Description

condition

Value

The condition to evaluate

then

() => TNode

Function returning content to render if condition is true

otherwise

() => TNode

(Optional) Optional function returning content to render if condition is false

Returns: Renderable

Renderable content