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

Method _runPendingEffects

www/js/_hyperscript-max.js:3323–3341  ·  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

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