mirror of https://github.com/sveltejs/svelte
fix: destructuring state in ssr (#16102)
parent
d5c6991b3b
commit
669a32a615
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: destructuring state in ssr
|
@ -0,0 +1 @@
|
|||||||
|
0, 1
|
@ -0,0 +1,11 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
let count = 0;
|
||||||
|
function* test(){
|
||||||
|
while (true) {
|
||||||
|
yield count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let [one, two] = $state(test())
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{one}, {two}
|
@ -0,0 +1 @@
|
|||||||
|
10, Admin
|
@ -0,0 +1,5 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
let [level, custom] = $state([10, "Admin"])
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{level}, {custom}
|
Loading…
Reference in new issue