Re:Show HN: Obey JavaScript Data Validation and Modeling
by wwalser on Saturday August 27, 2016 @02:30PM
(#12373529)
I don't understand why it returns a promise. Are some of the validators asynchronous (ex: call an outside resource and validate against the response)? All of the example appear to define validations that could be run synchronously.
[ Parent
| on HN ]
Re:Show HN: Obey JavaScript Data Validation and Modeling
by ksafranski on Sunday August 28, 2016 @08:16PM
(#12379223)
Two reasons:
1. It allows for asynchronous validation, see: http://technologyadvice.github.io/better-email-validation-wi...
2. It more cleanly supports the nature and flow of data i/o - in our use of Obey we are (almost) always following validation up with another async operation, i.e. obey.validate({}).then(...something else with the data...)