initial
This commit is contained in:
commit
74ae93a96e
2 changed files with 94691 additions and 0 deletions
|
|
@ -0,0 +1,7 @@
|
|||
basics
|
||||
|
||||
**links**
|
||||
https://github.com/stolinski/svelte-5-course
|
||||
https://youtu.be/8DQailPy3q8 : Svelte 5 Basics - Complete Svelte 5 Course for Beginners
|
||||
https://youtu.be/j3aliHghr3E : Data Flow in Svelte 5 | How to fetch & pass data from the backend to the frontend in SvelteKit
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
extras
|
||||
|
||||
about effect rune
|
||||
|
||||
```js
|
||||
<script>
|
||||
let count = $state(0);
|
||||
let doubled = $derived(count * 2);
|
||||
let triggerValue = $state('initial');
|
||||
|
||||
// This runs whenever any reactive value used inside changes
|
||||
$effect(() => {
|
||||
console.log('Effect ran:', count, doubled);
|
||||
});
|
||||
|
||||
// This will only run when triggerValue changes
|
||||
$effect(() => {
|
||||
console.log('Triggered effect:', triggerValue);
|
||||
// You can use other values here, but it won't re-run when they change
|
||||
}).with(triggerValue);
|
||||
</script>
|
||||
```
|
||||
Loading…
Reference in a new issue