@tempots/dom

OneOfType() function

Creates a field that renders one of the provided cases based on the value of the type property.

It uses the cases object to determine the appropriate field to render based on the value of type.

Signature:

OneOfType: extends {
    type: string;
}>(match: Value, cases: OneOfTypeOptions) => Renderable

Parameters

Parameter

Type

Description

match

Value

The signal that contains the object with the type property.

cases

OneOfTypeOptions

The options for rendering each case based on the type property.

Returns: Renderable

  • The rendered field.