FieldState

sealed class FieldState<T>(source)

The current state of a Field.

Inheritors

Constructors

Link copied to clipboard
protected constructor()

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.