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

Pushing validation side-effects later? #16

Open
Shadowfiend opened this issue Apr 19, 2017 · 0 comments
Open

Pushing validation side-effects later? #16

Shadowfiend opened this issue Apr 19, 2017 · 0 comments

Comments

@Shadowfiend
Copy link
Member

Currently validation side-effects are done in Field; that is, S.error is invoked during field handling. It may be worth considering pushing that into the form, so that the field simply returns a Box potentially including its error data, and the form submission handler is charged with invoking S.error. This would make it easier for the invoker to change the behavior (e.g., by not invoking S.error but marking the errors on the client differently, for example). It would also separate concerns a bit better, allowing the field to be solely charged with coordinating the field data, and not with marking the validation error in a client-specific way.

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

No branches or pull requests

1 participant