+<span class="punctuation">}</span></code></pre><div class="table"><table><tr><th></th><th>Type</th><th>Description</th></tr><tr><th><code><span class="keyword">this</span></code></th><td><code><span class="keyword">void</span></code></td><td></td></tr><tr><th><code>internals</code></th><td><code>Brand<span class="operator"><</span><span class="string">"ComponentInternals"</span><span class="operator">></span></code></td><td></td></tr><tr><th><code>props</code></th><td><code><span class="type"><a href="/api/ui-svelte/type-aliases/props/providerprops/">ProviderProps</a></span></code></td><td><p>The props passed to the component.</p></td></tr><tr><th class="right">returns</th><td><code><span class="punctuation">{</span> $on<span class="operator">?</span><span class="operator">:</span> <span class="punctuation">(</span>type<span class="operator">:</span> <span class="builtin">string</span><span class="punctuation">,</span> <span class="function-variable">callback</span><span class="operator">:</span> <span class="punctuation">(</span>e<span class="operator">:</span> <span class="builtin">any</span><span class="punctuation">)</span> <span class="operator">=></span> <span class="keyword">void</span><span class="punctuation">)</span><span class="operator">:</span> <span class="punctuation">(</span><span class="punctuation">)</span> <span class="operator">=></span> <span class="keyword">void</span><span class="punctuation">;</span> $set<span class="operator">?</span><span class="operator">:</span> <span class="punctuation">(</span>props<span class="operator">:</span> Partial<span class="operator"><</span><span class="type"><a href="/api/ui-svelte/type-aliases/props/providerprops/">ProviderProps</a></span><span class="operator">></span><span class="punctuation">)</span><span class="operator">:</span> <span class="keyword">void</span><span class="punctuation">;</span> <span class="punctuation">}</span></code></td><td><p></p></td></tr></table></div><p><a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> objects, <a href="/api/metrics/interfaces/metrics/metrics/"><code>Metrics</code></a>, <a href="/api/indexes/interfaces/indexes/indexes/"><code>Indexes</code></a>, <a href="/api/relationships/interfaces/relationships/relationships/"><code>Relationships</code></a>, <a href="/api/queries/interfaces/queries/queries/"><code>Queries</code></a>, <a href="/api/checkpoints/interfaces/checkpoints/checkpoints/"><code>Checkpoints</code></a>, Persisters, and Synchronizers can all be provided both as single defaults and as named instances in a <code>*ById</code> map.</p><p><code>Provider</code> components can be nested and their contexts are merged, so outer defaults and named instances remain visible unless a nearer Provider replaces them.</p><section class="s2"><h2>Example</h2><p>This example creates a Provider context with a default <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a>.</p><pre><code><span class="comment">// In a .svelte file:</span>
0 commit comments