rescriptbr / reform

📋 Reasonably making forms sound good
https://rescript-reform.netlify.app/
MIT License
354 stars 41 forks source link

ReSchema - add helper functions for validators #175

Closed fakenickels closed 4 years ago

fakenickels commented 4 years ago

So we can add more data in the validator constructors without hurting usability.

StringMin(Name, 20)
StringMax(Name, 20)

would become

string(~min=20, ~max=60, Name)

or

string(~min=20, Name)

or even finally add a label argument for better errors!

string(~min=20, ~label="Nome", Name)

in the end string is just a function that will return an array of the proper constructors for ReSchema

fakenickels commented 4 years ago

And of course we would provide a https://comby.dev script for easy conversion, both syntaxes would still be valid! ✨

fakenickels commented 4 years ago

Closed by https://github.com/Astrocoders/reform/pull/171