DEV Community

Discussion on: Parametrized Validators in Dynamic Forms

matheo profile image
Mateo Tibaquirá Author

I. Yes, ['range', [1, 5]] will be translated to its corresponding Factory call like fn(1, 5) and for more complex cases an object could be used like ['asyncUniqueEmail', { endpoint: '...', minLength: 4, ... }] and you will receive it in your Factory fn({ endpoint, minLength, ... }) :)

II. Let's try to implement that Validator with Matchers for the next chapter of this series:

Thank you for your feedback! :D