to

infix fun <T> T.to(visualizer: FieldVisualizer<T>): Form.Field<T>(source)

DSL for binding an arbitrary value to a FieldVisualizer to create a Field with an initial state of Valid(this) within a Form.

NOTE: the FieldVisualizer ultimately decides what inputs are valid, so the value of T used may be ignored if the visualizer deemed it invalid.

Form {
this(
someValue to field { ... }, // trys to bind someValue to the created Field
...
) { first, ... ->
...
}
}

infix fun <T> Form.FieldState<T>.to(visualizer: FieldVisualizer<T>): Form.Field<T>(source)

DSL for binding a FieldState to a FieldVisualizer to create a Field with an initial state equal to the given FieldState within a Form.

NOTE: the FieldVisualizer ultimately decides what inputs are valid, so a Valid may be ignored if the visualizer deems it invalid.

Form {
this(
someField to field { ... }, // trys to bind someField to the created Field
...
) { first, ... ->
...
}
}