@tempots/dom
OneOf() function
Creates a renderable function that renders different components based on the value of a signal.
The signal value should be an object with a single key that matches one of the keys in the cases
object.
Signature:
OneOf: extends Record<string, unknown>>(match: Value, cases: OneOfOptions) => Renderable
Parameters
Parameter |
Type |
Description |
---|---|---|
match |
The signal or value to match against. | |
cases |
An object containing the different cases to render based on the signal value. |
Returns: Renderable
A renderable function that renders the appropriate component based on the signal value.