API overview
Core module “isomorphic-validation”
The core module of the library exports two entities: Validation and Predicate.
Instance methods:
Instance properties:
Static methods:
Validation object
A Validation object can be created several ways:
- a single
Validationis created by the constructor function. - a grouping
Validationis created by the static methodsValidation.group()andValidation.glue() - also a grouping
Validationwith nested (grouped), bound to form fieldsValidationobjects is created by theValidation.profile()static method. - and lastly, a single
Validationis created by theValidation.clone()method from anotherValidation.
Nested (grouped) Validation objects are accessed through:
- the
Validation().validationsproperty. - by form field names when created using the
Validation.profile()method.
Predicate object
A Predicate object can be created:
- by the constructor function.
- cloned from another
Predicateobject when passed into the constructor function.
Predicate objects added to validations can be accessed:
- through the
Validation().constraintsproperty. - in state callbacks through the
ValidationResultobject passed in.
UI module “isomorphic-validation/ui”
The UI module exports the following set of helper, renderer and effect functions for performing UI side effects: