@tempots/dom

OneOfField() function

Creates a renderable that renders different components based on the value of the specified field.

Signature:

OneOfField: extends { [_ in K]: string; }, K extends string>(match: Value, field: K, cases: OneOfFieldOptions) => Renderable

Parameters

Parameter

Type

Description

match

Value

The signal or value that emits the object containing the one-of field.

field

K

The key of the one-of field.

cases

OneOfFieldOptions

The options for the different cases of rendering based on the one-of field value.

Returns: Renderable

  • The renderable field representing the one-of field.