mirror of https://github.com/sveltejs/svelte
feat: migrate reassigned deriveds to `$derived` (#15581)
parent
c1ae8953aa
commit
33d118f8a2
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
feat: migrate reassigned deriveds to `$derived`
|
@ -0,0 +1,10 @@
|
|||||||
|
<script>
|
||||||
|
let name = 'world';
|
||||||
|
|
||||||
|
$: upper = name.toUpperCase();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<input bind:value={name} />
|
||||||
|
<input bind:value={upper} />
|
||||||
|
|
||||||
|
{upper}
|
@ -0,0 +1,10 @@
|
|||||||
|
<script>
|
||||||
|
let name = $state('world');
|
||||||
|
|
||||||
|
let upper = $derived(name.toUpperCase());
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<input bind:value={name} />
|
||||||
|
<input bind:value={upper} />
|
||||||
|
|
||||||
|
{upper}
|
Loading…
Reference in new issue