Function tag

  • Creates a tag data accessor for a target object of a certain type. Tag data will be lazy created on access and reused for the same target object.

    Type Parameters

    • Target extends object
    • TagData

    Parameters

    • tagDataConstructor: ((target) => TagData)

      Function that will be called the first time the tag for a given object is requested.

    Returns {
        for(target): TagData;
    }

    The tag data associated with the target object.

    Typeparam

    Target Target type.

    Typeparam

    TagData Tag data type.