We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, validator API looks like this:
Custom(state => option(string))
Which is IMHO pretty confusing and requires you to read doc/source code to actually know what is option(string) actually means.
option(string)
I would suggest that we use result type. It's in OCaml 4.0.3 but Bucklescript provides us a compat type Js.Result.t
Usage:
open Js.Result; type validateResult = Js.Result.t(unit, string); ... Custom(values => values.password == "123" ? Error("Really") : Ok())
And I think using result type should be self-described
The text was updated successfully, but these errors were encountered:
Sounds interesting
Sorry, something went wrong.
But for me it looks similar, using option or Result in this case. Let's see what the others think about this
We have now something similar to this Valid | Error(string)
No branches or pull requests
Currently, validator API looks like this:
Which is IMHO pretty confusing and requires you to read doc/source code to actually know what is
option(string)
actually means.I would suggest that we use result type. It's in OCaml 4.0.3 but Bucklescript provides us a compat type Js.Result.t
Usage:
And I think using result type should be self-described
The text was updated successfully, but these errors were encountered: