Skip to content

Commit 8f8de50

Browse files
committed
better comment
1 parent f872934 commit 8f8de50

File tree

1 file changed

+3
-2
lines changed
  • packages/svelte/src/internal/client/dom/blocks

1 file changed

+3
-2
lines changed

packages/svelte/src/internal/client/dom/blocks/each.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ function pause_effects(state, to_destroy, controlled_anchor) {
8080
}
8181

8282
run_out_transitions(transitions, () => {
83-
// If we have a controlled anchor, it means that the each block is inside a single
84-
// DOM element, so we can apply a fast-path for clearing the contents of the element.
83+
// If we're in a controlled each block (i.e. the block is the only child of an
84+
// element), and we are removing all items, _and_ there are no out transitions,
85+
// we can use the fast path — emptying the element and replacing the anchor
8586
var fast_path = transitions.length === 0 && controlled_anchor !== null;
8687

8788
// TODO only destroy effects if no pending batch needs them. otherwise,

0 commit comments

Comments
 (0)