From b44bd67fa5feac64ce2c84188e38569e50330362 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Mon, 14 Jul 2025 11:45:09 -0400 Subject: [PATCH] add comment --- .../svelte/src/internal/client/dom/blocks/boundary.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/svelte/src/internal/client/dom/blocks/boundary.js b/packages/svelte/src/internal/client/dom/blocks/boundary.js index 7084481bd5..5ed0515210 100644 --- a/packages/svelte/src/internal/client/dom/blocks/boundary.js +++ b/packages/svelte/src/internal/client/dom/blocks/boundary.js @@ -83,7 +83,13 @@ export class Boundary { #pending_count = 0; #is_creating_fallback = false; - /** @type {Source | null} */ + /** + * A source containing the number of pending async deriveds/expressions. + * Only created if `$effect.pending()` is used inside the boundary, + * otherwise updating the source results in needless `Batch.ensure()` + * calls followed by no-op flushes + * @type {Source | null} + */ #effect_pending = null; #effect_pending_subscriber = createSubscriber(() => {