invoke

operator fun <A> invoke(a: Form.Field<A>, onInvalid: () -> Unit, onReady: (A) -> Unit): Form.Companion.FormDefinition(source)

Defines a Form with a single Field.

Parameters

a

the form's only field

onInvalid

called whenever the form has new input and any of its fields are Invalid

onReady

called whenever the form has new input and all its fields are Valid


operator fun <A, B> invoke(a: Form.Field<A>, b: Form.Field<B>, onInvalid: () -> Unit, onReady: (A, B) -> Unit): Form.Companion.FormDefinition(source)

Defines a Form with a 2 Fields.

Parameters

a

the form's first field

b

the form's second field

onInvalid

called whenever the form has new input and any of its fields are Invalid

onReady

called whenever the form has new input and all its fields are Valid


operator fun <A, B, C> invoke(a: Form.Field<A>, b: Form.Field<B>, c: Form.Field<C>, onInvalid: () -> Unit, onReady: (A, B, C) -> Unit): Form.Companion.FormDefinition(source)

Defines a Form with a 3 Fields.

Parameters

a

the form's first field

b

the form's second field

c

the form's third field

onInvalid

called whenever the form has new input and any of its fields are Invalid

onReady

called whenever the form has new input and all its fields are Valid


operator fun <A, B, C, D> invoke(a: Form.Field<A>, b: Form.Field<B>, c: Form.Field<C>, d: Form.Field<D>, onInvalid: () -> Unit = { }, onReady: (A, B, C, D) -> Unit = { _,_,_,_ -> }): Form.Companion.FormDefinition(source)

Defines a Form with a 4 Fields.

Parameters

a

the form's first field

b

the form's second field

c

the form's third field

d

the form's fourth field

onInvalid

called whenever the form has new input and any of its fields are Invalid

onReady

called whenever the form has new input and all its fields are Valid


operator fun <A, B, C, D, E> invoke(a: Form.Field<A>, b: Form.Field<B>, c: Form.Field<C>, d: Form.Field<D>, e: Form.Field<E>, onInvalid: () -> Unit, onReady: (A, B, C, D, E) -> Unit): Form.Companion.FormDefinition(source)

Defines a Form with a 5 Fields.

Parameters

a

the form's first field

b

the form's second field

c

the form's third field

d

the form's fourth field

e

the form's fifth field

onInvalid

called whenever the form has new input and any of its fields are Invalid

onReady

called whenever the form has new input and all its fields are Valid


operator fun invoke(first: Form.Field<*>, second: Form.Field<*>, vararg rest: Form.Field<*>, onInvalid: () -> Unit, onReady: (List<*>) -> Unit): Form.Companion.FormDefinition(source)

Defines a Form with at least 2 Fields. The values provided to onReady, though untyped, are in the definition order within invoke. This allows the consumer to cast them to the expected types.

Parameters

first

the form's first field

second

the form's second field

rest

the form's remaining fields

onInvalid

called whenever the form has new input and any of its fields are Invalid

onReady

called whenever the form has new input and all its fields are Valid