Usage with React

Thanks to the fact validate function returns input values (basically proxies them) it's very convenient to use for React.js action creators.

Let's take for example an extract from Puppetry domain model:

Example of domain model

This model can be expressed with byContract interfaces in a separate module like that:

./interface/index.js

We import the defined interfaces as I interface and use to validate action arguments ./actions/entity.js

Last updated

Was this helpful?