Field

class Field<T>(source)

An entry within a Form that represents a single parameter and value that will be presented when the form becomes ready.

Properties

Link copied to clipboard

The field's current state

Functions

Link copied to clipboard
inline fun <R, T> Form.Field<T>.fold(onValid: (value: T) -> R, default: R): R

Returns the result of onValid if this instance is valid or default if it is invalid.

Link copied to clipboard
inline fun <T> Form.Field<T>.ifValid(onValid: (value: T) -> Unit)

Does the action of onValid if this instance is valid.

Link copied to clipboard
inline fun <T, R> Form.Field<T>.mapValue(onValid: (value: T) -> R): Form.FieldState<R>

Returns a valid state from the result of onValid if this instance is valid or invalid otherwise.