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

Method _handleMutations

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

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

Callers 1

_initGlobalObserverMethod · 0.45

Calls 2

_scheduleQueryEffectsMethod · 0.45

Tested by

no test coverage detected