Skip to content

Commit f991d9d

Browse files
committed
remove TODO - this method is only called when pending snippet exists
1 parent 54e3925 commit f991d9d

File tree

1 file changed

+7
-14
lines changed
  • packages/svelte/src/internal/client/dom/blocks

1 file changed

+7
-14
lines changed

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

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -196,22 +196,15 @@ export class Boundary {
196196
}
197197

198198
#show_pending_snippet() {
199-
const pending = this.#props.pending;
199+
const pending = /** @type {(anchor: Node) => void} */ (this.#props.pending);
200200

201-
if (pending !== undefined) {
202-
// TODO can this be false?
203-
if (this.#main_effect !== null) {
204-
this.#offscreen_fragment = document.createDocumentFragment();
205-
move_effect(this.#main_effect, this.#offscreen_fragment);
206-
}
201+
if (this.#main_effect !== null) {
202+
this.#offscreen_fragment = document.createDocumentFragment();
203+
move_effect(this.#main_effect, this.#offscreen_fragment);
204+
}
207205

208-
if (this.#pending_effect === null) {
209-
this.#pending_effect = branch(() => pending(this.#anchor));
210-
}
211-
} else if (this.parent) {
212-
throw new Error('TODO show pending snippet on parent');
213-
} else {
214-
throw new Error('no pending snippet to show');
206+
if (this.#pending_effect === null) {
207+
this.#pending_effect = branch(() => pending(this.#anchor));
215208
}
216209
}
217210

0 commit comments

Comments
 (0)