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: Target) => TagData)

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

    Returns {
        for(target: Target): TagData;
    }

    The tag data associated with the target object.

    Target Target type.

    TagData Tag data type.