If anything other than a function is passed in the corresponding error will be thrown.
Description
Adds state callbacks to the Predicate object. Once the Predicate 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.