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

Method _runPendingEffects

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

3320 * Effects that re-trigger during this run are queued for the next batch.
3321 */
3322 _runPendingEffects() {
3323 this._isRunScheduled = false;
3324 var effects = Array.from(this._pendingEffects);
3325 this._pendingEffects.clear();
3326 for (var i = 0; i < effects.length; i++) {
3327 var effect = effects[i];
3328 if (effect._isStopped) continue;
3329 if (effect.element && !effect.element.isConnected) {
3330 effect.stop();
3331 continue;
3332 }
3333 effect.run();
3334 }
3335 if (this._pendingEffects.size === 0) {
3336 for (var i = 0; i < effects.length; i++) {
3337 if (!effects[i]._isStopped) effects[i].resetTriggerCount();
3338 }
3339 }
3340 }
3341 /**
3342 * Subscribe an effect to all its current deps.
3343 * Symbols go into per-element/global subscription maps.

Callers 1

_scheduleEffectMethod · 0.45

Calls 3

stopMethod · 0.45
runMethod · 0.45
resetTriggerCountMethod · 0.45

Tested by

no test coverage detected