π Smithery is now a part of Arcade.dev! Read more in our announcement here
Remote functions reactive UI patterns. Use for smooth in-place updates, preventing page jumps, and managing loading states with .current property.
<script lang="ts"> const data_query = get_data(); // Store in variable for .current access async function save(id: string, value: string) { await update_data({ id, value }); await data_query.refresh(); // Updates in place! } </script> {#if data_query.error} <p>Error loading data</p> {:else if data_query.loading && data_query.current === undefined} <p>Loading...</p> {:else} {@const items = data_query.current ?? []} <div class:opacity-60={data_query.loading}> {#each items as item}<!-- Content updates smoothly -->{/each} </div> {/if}
const query = get_data()
.current
.current === undefined
{#await}