gradum-kit - v0.1.0
    Preparing search index...

    Function constrainer

    • Function

      Parameters

      • Optionalname: string

        The key name of the constrainer in the MVC instance (if any). By default, it is inferred from the name of the field. If the field is named somethingConstrainer, the key name will be something.

      Returns (_unused: unknown, context: ClassFieldDecoratorContext) => void

      constrainer

      Stage-3 field decorator for MVC structure. It reduces code by turning the decorated field into a fetched constrainer.

      @tool() protected textConstrainer: GradumConstrainer;
      

      Is equivalent to:

      protected get textConstrainer(): GradumConstrainer {
      if (this.mvc instanceof Mvc) return this.mvc.getConstrainer("text");
      if (typeof this.getConstrainer === "function") return this.getConstrainer("text");
      }