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

Method _runPendingEffects

tools/common/_hyperscript.iife.js:3151–3169  ·  view source on GitHub ↗

* Run all pending effects. Called once per microtask batch. * Effects that re-trigger during this run are queued for the next batch.

()

Source from the content-addressed store, hash-verified

3149 * Effects that re-trigger during this run are queued for the next batch.
3150 */
3151 _runPendingEffects() {
3152 this._isRunScheduled = false;
3153 var effects = Array.from(this._pendingEffects);
3154 this._pendingEffects.clear();
3155 for (var i = 0; i < effects.length; i++) {
3156 var effect = effects[i];
3157 if (effect._isStopped) continue;
3158 if (effect.element && !effect.element.isConnected) {
3159 effect.stop();
3160 continue;
3161 }
3162 effect.run();
3163 }
3164 if (this._pendingEffects.size === 0) {
3165 for (var i = 0; i < effects.length; i++) {
3166 if (!effects[i]._isStopped) effects[i].resetTriggerCount();
3167 }
3168 }
3169 }
3170 /**
3171 * Subscribe an effect to all its current deps.
3172 * Symbols go into subscription maps, attributes get MutationObservers,

Callers 1

_scheduleEffectMethod · 0.45

Calls 3

stopMethod · 0.45
runMethod · 0.45
resetTriggerCountMethod · 0.45

Tested by

no test coverage detected