Replies: 1 comment 4 replies
-
|
Hey 👋 thanks for reaching out! Wouldn't it be better to fetch the data first and then validate it with Valibot? This would give you full control over the data fetching process. @dosu what do you think? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Would you consider adding APIs for executing actions that can throw errors, following Valibot's existing mental model and function signatures?
Packages like neverthrow or better-result require different ways of thinking about composition (e.g Switching between
v.pipe(v.string(), v.email())andResult.try()orfromThrowable()) and converting between Valibot's issues/output types and Result<T, E> types adds boilerplate.Example (Bikeshedable)
Alternative Approaches
I understand this is a departure from Valibot's current scope as a pure validation library. The reason why this is difficult to implement as an external package is it may require slight changes to Valibot core such as
v.pipe(...)andBaseIssue.Beta Was this translation helpful? Give feedback.
All reactions