Skip to content

Commit 51faf07

Browse files
authored
update runes $effect example (#11137)
1 parent fe21a79 commit 51faf07

File tree

1 file changed

+2
-2
lines changed
  • sites/svelte-5-preview/src/routes/docs/content/01-api

1 file changed

+2
-2
lines changed

sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,10 @@ An effect only reruns when the object it reads changes, not when a property insi
252252
</script>
253253
254254
<button on:click={() => object.count++}>
255-
{doubled}
255+
{derived_object.doubled}
256256
</button>
257257
258-
<p>{count} doubled is {doubled}</p>
258+
<p>{object.count} doubled is {derived_object.doubled}</p>
259259
```
260260

261261
You can return a function from `$effect`, which will run immediately before the effect re-runs, and before it is destroyed ([demo](/#H4sIAAAAAAAAE42SzW6DMBCEX2Vl5RDaVCQ9JoDUY--9lUox9lKsGBvZC1GEePcaKPnpqSe86_m0M2t6ViqNnu0_e2Z4jWzP3pqGbRhdmrHwHWrCUHvbOjF2Ei-caijLTU4aCYRtDUEKK0-ccL2NDstNrbRWHoU10t8Eu-121gTVCssSBa3XEaQZ9GMrpziGj0p5OAccCgSHwmEgJZwrNNihg6MyhK7j-gii4uYb_YyGUZ5guQwzPdL7b_U4ZNSOvp9T2B3m1rB5cLx4zMkhtc7AHz7YVCVwEFzrgosTBMuNs52SKDegaPbvWnMH8AhUXaNUIY6-hHCldQhUIcyLCFlfAuHvkCKaYk8iYevGGgy2wyyJnpy9oLwG0sjdNe2yhGhJN32HsUzi2xOapNpl_bSLIYnDeeoVLZE1YI3QSpzSfo7-8J5PKbwOmdf2jC6JZyD7HxpPaMk93aHhF6utVKVCyfbkWhy-hh9Z3o_2nQIAAA==)).

0 commit comments

Comments
 (0)