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

Method trackQuery

src/core/runtime/reactivity.js:268–274  ·  view source on GitHub ↗

* Track a DOM query as a dependency. Re-evaluates when any DOM * change occurs within root or its descendants. * @param {Element|Document} root - the element querySelectorAll runs on (e.g. #myTable in `<:checked/> in #myTable`)

(root)

Source from the content-addressed store, hash-verified

266 * @param {Element|Document} root - the element querySelectorAll runs on (e.g. #myTable in `<:checked/> in #myTable`)
267 */
268 trackQuery(root) {
269 if (!this._currentEffect) return;
270 root = root || document;
271 var key = "query:" + this._getObjectState(root).id;
272 this._currentEffect.dependencies.set(key,
273 { type: "query", root: root });
274 }
275
276 /**
277 * Notify that a global variable was written.

Callers 1

resolveQueryMethod · 0.45

Calls 2

_getObjectStateMethod · 0.95
setMethod · 0.45

Tested by

no test coverage detected