Validation().invalid() method
Adds state callbacks which will be invoked during the execution of the Validation().validate()
method when at least one predicate in the predicate groups of the Validation
becomes “invalid”, in other words at least one predicate function returns false
or a Promise
that fulfills with false
.
Syntax
Parameters
-
callback1, ..., callbackN
Functions to add. The callback functions will be called with the following arguments:validationResult
AValidationResult
object.
Return value
The Validation
object.
Exceptions
If anything other than a function is passed in the corresponding error will be thrown.
Description
Adds state callbacks to the Validation
object. Once the Validation
in the specified state, the corresponding callbacks will be invoked one by one in the order they were added. The main purpose of state callbacks is to perform side effects related to the state. A ValidationResult
object is passed into state callbacks.