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

Function pause_effect

packages/svelte/src/internal/client/reactivity/effects.js:609–629  ·  view source on GitHub ↗
(effect, callback, destroy = true)

Source from the content-addressed store, hash-verified

607 * @param {boolean} [destroy]
608 */
609export function pause_effect(effect, callback, destroy = true) {
610 /** @type {TransitionManager[]} */
611 var transitions = [];
612
613 pause_children(effect, transitions, true);
614
615 var fn = () => {
616 if (destroy) destroy_effect(effect);
617 if (callback) callback();
618 };
619
620 var remaining = transitions.length;
621 if (remaining > 0) {
622 var check = () => --remaining || fn();
623 for (var transition of transitions) {
624 transition.out(check);
625 }
626 } else {
627 fn();
628 }
629}
630
631/**
632 * @param {Effect} effect

Callers 7

BranchManagerClass · 0.90
pause_effectsFunction · 0.90
commitFunction · 0.90
#update_pending_countMethod · 0.90
resetMethod · 0.90
component_rootFunction · 0.85

Calls 2

pause_childrenFunction · 0.85
fnFunction · 0.70

Tested by

no test coverage detected