let and '$:' operator

I’m studing sveltekit and I always see the following statement

let { session, supabase, profile } = data
$: ({ session, supabase, profile } = data)

what it is the meaning of "$:"?


>Solution :

In SvelteKit, the $: symbol is used to create a reactive statement.
It’s often referred to as a:
"reactive declaration" or "reactive statement",
and it is to be re-executed whenever the variables change.

You can read about it here:

or here:

Leave a Reply