* Run all pending effects. Called once per microtask batch. * Effects that re-trigger during this run are queued for the next batch.
()
| 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, |
no test coverage detected