You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
source and source::select no longer accept generics T, instead source::select::json and source::select::transform will each accept separate generics.
Meaning you will now type your values like so with source::select::json
<!-- +page.svelte -->
<scriptlang="ts">
import { source } from'sveltekit-sse'typeUser= { username:string }// For the sake of brevity// let's suppose all the event emits // is the raw name of the userfunction transformer(raw:string):User{return { username: raw } }const user =source('/my-event') .select('user') .transform<User>(transformer)
</script>
{#if$user}
<h3>{$user.username}</h3>
{/if}