Construct a new attached property.
The options for initializing the property.
Private
_changedPrivate
_coercePrivate
_comparePrivate
_createPrivate
_pidReadonly
nameThe human readable name for the property.
Private
_coercePrivate
_comparePrivate
_createPrivate
_maybeExplicitly coerce the current property value for a given owner.
The property owner of interest.
If the value has not yet been set, the default value will be computed and used as the previous value for the comparison.
Get the current value of the property for a given owner.
The property owner of interest.
The current value of the property.
If the value has not yet been set, the default value will be computed and assigned as the current value of the property.
Set the current value of the property for a given owner.
The property owner of interest.
The value for the property.
If the value has not yet been set, the default value will be computed and used as the previous value for the comparison.
Generated using TypeDoc
A class which attaches a value to an external object.
Notes
Attached properties are used to extend the state of an object with semantic data from an unrelated class. They also encapsulate value creation, coercion, and notification.
Because attached property values are stored in a hash table, which in turn is stored in a WeakMap keyed on the owner object, there is non-trivial storage overhead involved in their use. The pattern is therefore best used for the storage of rare data.