Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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 "$:"?

Thanks

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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:
https://geoffrich.net/posts/svelte-$-meanings/

or here:
https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Client-side_JavaScript_frameworks/Svelte_variables_props#

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading