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

Method trackAttribute

www/js/_hyperscript.esm.js:3133–3139  ·  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

3131 * @param {string} name - Attribute name
3132 */
3133 trackAttribute(element, name) {
3134 if (!(element instanceof Element)) return;
3135 this._currentEffect.dependencies.set(
3136 "attribute:" + name + ":" + this._getObjectState(element).id,
3137 { type: "attribute", element, name }
3138 );
3139 }
3140 /**
3141 * Track a DOM query as a dependency. Re-evaluates when any DOM
3142 * 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