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

Method _runPendingEffects

www/js/_hyperscript.js:3324–3342  ·  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

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