Integrating Form Validation #53
Answered
by
arkivanov
manosbatsis
asked this question in
Q&A
-
Hi @arkivanov, thank you for all your great work. Hope you don't mind entertaining these:
|
Beta Was this translation helpful? Give feedback.
Answered by
arkivanov
Jul 20, 2022
Replies: 1 comment 2 replies
-
Thanks for the question!
Here is a possible State class: data class Field<T>(val value: T, val isError: Boolean)
data class State(
val email: Field<String>,
val phoneNumber: Field<String>,
) In order to keep the |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
arkivanov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the question!
form-builder
is tightly coupled with Jetpack Compose. I don't see any reasonable way of using those libraries together with MVIKotlin.Store
holds the state and manages its changes consistently. You can just have all fields in the state class, and either validate values while they are being changed, or later on submission.Here is a possible State class:
In order to keep the
Store
as simple possible, the validation lo…