mobx-sentinel API doc
    Preparing search index...

    Interface ValidationErrorMapBuilder<T>

    Builder for collecting validation errors

    Key features:

    • Collects errors for multiple keys
    • Can invalidate the target object itself
    interface ValidationErrorMapBuilder<T> {
        hasError: boolean;
        invalidate(key: keyof T & string, reason: string | Error): void;
        invalidateSelf(reason: string | Error): void;
    }

    Type Parameters

    • T
    Index
    hasError: boolean

    Whether the builder has any errors

    • Add an error for a key

      Parameters

      • key: keyof T & string

        Key to invalidate

      • reason: string | Error

        Error message or Error object

      Returns void

      Multiple reasons can be added for the same key.

    • Invalidate the target object itself

      Parameters

      • reason: string | Error

      Returns void

      This is useful with @nested.hoist to invalidate the parent object.