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

Method _handleMutations

www/js/_hyperscript.js:3249–3260  ·  view source on GitHub ↗

* Handle MutationObserver callbacks. Dispatches to attribute and query * subscriptions based on mutation type. * @param {MutationRecord[]} mutations

(mutations)

Source from the content-addressed store, hash-verified

3247 * @param {MutationRecord[]} mutations
3248 */
3249 _handleMutations(mutations) {
3250 var hasQueries = this._querySubscriptions.size > 0;
3251 var queryTargets = hasQueries ? /* @__PURE__ */ new Set() : null;
3252 for (var i = 0; i < mutations.length; i++) {
3253 var mutation = mutations[i];
3254 if (mutation.type === "attributes") {
3255 this._scheduleAttributeEffects(mutation.target, mutation.attributeName);
3256 }
3257 if (queryTargets) queryTargets.add(mutation.target);
3258 }
3259 if (queryTargets) this._scheduleQueryEffects(queryTargets);
3260 }
3261 /**
3262 * Handle delegated input/change events. Dispatches to property and
3263 * query subscriptions.

Callers 1

_initGlobalObserverMethod · 0.45

Calls 2

_scheduleQueryEffectsMethod · 0.45

Tested by

no test coverage detected