Valid

class Valid<T>(val value: T) : Form.FieldState<T> (source)

Fields with this state have a value and no longer block their Form from becoming ready.

Constructors

Link copied to clipboard
constructor(value: T)

Properties

Link copied to clipboard
val value: T

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Inherited functions

Link copied to clipboard
inline fun <R, T> Form.FieldState<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.FieldState<T>.ifInvalid(onInvalid: () -> Unit)

Does the action of onInvalid if this instance is invalid.

Link copied to clipboard
inline fun <T> Form.FieldState<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.FieldState<T>.map(onValid: (value: T) -> R): Form.FieldState<R>

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