Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Components validation #244

Merged
merged 8 commits into from Jan 22, 2021
Merged

Components validation #244

merged 8 commits into from Jan 22, 2021

Conversation

jamowei
Copy link
Collaborator

@jamowei jamowei commented Jan 19, 2021

If added a first draft of component validation. Please review!
Take a look here for running example.

@jamowei jamowei added this to the 0.9 milestone Jan 19, 2021
@jamowei jamowei requested review from jwstegemann and a user January 19, 2021 13:30
@jamowei jamowei self-assigned this Jan 19, 2021
@ghost
Copy link

ghost commented Jan 19, 2021

Looks quite nice to me!

I believe you prefered to remain flexible with the type of the store by relying on runtime type checking within the fun <D> Store<D>.validationMessage(): Flow<String> function instead of defining some ValidateableStore, which all of our components then would have to adopt, even if there is no need of validation? (A possible typed variant would require some kind of null pattern for the validator in order to remain kinda optional though.)

I would like to tinker a small example for our formControl component in order to get a feeling how this approach fits there. My initial guess is, that this would work very good, as the store is injected into the underlying sub component, but the validation is handled by the formControl itself. With this kinda dynamic approach one could try to validate but catch the RootStoreIsNotValidatable if validation is not possible. Thus the user is not forced to implement validation if not needed.

@jamowei
Copy link
Collaborator Author

jamowei commented Jan 19, 2021

Ok, I have done the rework. Please review again and if there is noting left to do, I will start documenting.
@jwstegemann @chausknecht

@jamowei jamowei marked this pull request as ready for review January 22, 2021 10:10
@jwstegemann jwstegemann merged commit 58483a6 into master Jan 22, 2021
@jwstegemann jwstegemann deleted the jamowei/componentsValidation branch January 22, 2021 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants