Function useValidator

  • A validator is a waitable that produces a ValidationResult, indicating either validity or a problem, if all of its dependencies are loaded (or if the validator is disabled).

    Basic example:

    const myBindingValidator = useValidator(myBinding, checkEquals('hello', 'expected "hello"'), { id: 'myBindingValidator' });
    console.log('isValid', myBindingValidator.value.get()?.isValid);

    Type Parameters

    • DependenciesT extends WaitableDependencies

    Parameters

    Returns Validator

Generated using TypeDoc