MCPcopy
hub / github.com/sveltejs/svelte / pause_children

Function pause_children

packages/svelte/src/internal/client/reactivity/effects.js:636–672  ·  view source on GitHub ↗

* @param {Effect} effect * @param {TransitionManager[]} transitions * @param {boolean} local

(effect, transitions, local)

Source from the content-addressed store, hash-verified

634 * @param {boolean} local
635 */
636function pause_children(effect, transitions, local) {
637 if ((effect.f & INERT) !== 0) return;
638 effect.f ^= INERT;
639
640 var t = effect.nodes && effect.nodes.t;
641
642 if (t !== null) {
643 for (const transition of t) {
644 if (transition.is_global || local) {
645 transitions.push(transition);
646 }
647 }
648 }
649
650 var child = effect.first;
651
652 while (child !== null) {
653 var sibling = child.next;
654
655 // If this child is a root effect, then it will become an independent root when its parent
656 // is destroyed, it should therefore not become inert nor partake in transitions.
657 if ((child.f & ROOT_EFFECT) === 0) {
658 var transparent =
659 (child.f & EFFECT_TRANSPARENT) !== 0 ||
660 // If this is a branch effect without a block effect parent,
661 // it means the parent block effect was pruned. In that case,
662 // transparency information was transferred to the branch effect.
663 ((child.f & BRANCH_EFFECT) !== 0 && (effect.f & BLOCK_EFFECT) !== 0);
664 // TODO we don't need to call pause_children recursively with a linked list in place
665 // it's slightly more involved though as we have to account for `transparent` changing
666 // through the tree.
667 pause_children(child, transitions, transparent ? local : false);
668 }
669
670 child = sibling;
671 }
672}
673
674/**
675 * The opposite of `pause_effect`. We call this if (for example)

Callers 1

pause_effectFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected