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

Class Boundary

packages/svelte/src/internal/client/dom/blocks/boundary.js:66–523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66export class Boundary {
67 /** @type {Boundary | null} */
68 parent;
69
70 is_pending = false;
71
72 /**
73 * API-level transformError transform function. Transforms errors before they reach the `failed` snippet.
74 * Inherited from parent boundary, or defaults to identity.
75 * @type {(error: unknown) => unknown}
76 */
77 transform_error;
78
79 /** @type {TemplateNode} */
80 #anchor;
81
82 /** @type {TemplateNode | null} */
83 #hydrate_open = hydrating ? hydrate_node : null;
84
85 /** @type {BoundaryProps} */
86 #props;
87
88 /** @type {((anchor: Node) => void)} */
89 #children;
90
91 /** @type {Effect} */
92 #effect;
93
94 /** @type {Effect | null} */
95 #main_effect = null;
96
97 /** @type {Effect | null} */
98 #pending_effect = null;
99
100 /** @type {Effect | null} */
101 #failed_effect = null;
102
103 /** @type {DocumentFragment | null} */
104 #offscreen_fragment = null;
105
106 #local_pending_count = 0;
107 #pending_count = 0;
108 #pending_count_update_queued = false;
109
110 /** @type {Set<Effect>} */
111 #dirty_effects = new Set();
112
113 /** @type {Set<Effect>} */
114 #maybe_dirty_effects = new Set();
115
116 /**
117 * A source containing the number of pending async deriveds/expressions.
118 * Only created if `$effect.pending()` is used inside the boundary,
119 * otherwise updating the source results in needless `Batch.ensure()`
120 * calls followed by no-op flushes
121 * @type {Source<number> | null}
122 */
123 #effect_pending = null;

Callers

nothing calls this directly

Calls 3

createSubscriberFunction · 0.90
sourceFunction · 0.90
tagFunction · 0.90

Tested by

no test coverage detected