fold

inline fun <R, T> Form.FieldState<T>.fold(onValid: (value: T) -> R, default: R): R(source)
inline fun <R, T> Form.Field<T>.fold(onValid: (value: T) -> R, default: R): R(source)

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