Function: tag()
function tag<Target, TagData>(tagDataConstructor): object;
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
| Type Parameter | Description |
|---|---|
Target extends object | Target type. |
TagData | Tag data type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
tagDataConstructor | (target) => TagData | Function that will be called the first time the tag for a given object is requested. |
Returns
object
The tag data associated with the target object.
for()
for(target): TagData;
Parameters
| Parameter | Type |
|---|---|
target | Target |
Returns
TagData