MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / trackAttribute

Method trackAttribute

www/js/_hyperscript.js:3135–3141  ·  view source on GitHub ↗

* Track a DOM attribute read as a dependency. * @param {Element} element * @param {string} name - Attribute name

(element, name)

Source from the content-addressed store, hash-verified

3133 * @param {string} name - Attribute name
3134 */
3135 trackAttribute(element, name) {
3136 if (!(element instanceof Element)) return;
3137 this._currentEffect.dependencies.set(
3138 "attribute:" + name + ":" + this._getObjectState(element).id,
3139 { type: "attribute", element, name }
3140 );
3141 }
3142 /**
3143 * Track a DOM query as a dependency. Re-evaluates when any DOM
3144 * change occurs within root or its descendants.

Callers 1

resolveAttributeMethod · 0.45

Calls 2

setMethod · 0.45
_getObjectStateMethod · 0.45

Tested by

no test coverage detected