Add tests for reassigning stores with object destructuring

pull/8846/head
Nguyen Tran 3 years ago
parent 58e8bcfaf5
commit 9400b2f441

@ -0,0 +1,10 @@
export default {
html: `
<p>7</p>
<p>8</p>
<p>9</p>
<p>10</p>
<p>11</p>
<p>12</p>
`
};

@ -0,0 +1,29 @@
<script>
import { writable } from 'svelte/store'
let { firstNonStore, secondNonStore, thirdNonStore, firstStore, fourthNonStore, secondStore } = {
firstNonStore: 1,
secondNonStore: 2,
thirdNonStore: 3,
firstStore: writable(4),
fourthNonStore: 5,
secondStore: writable(6)
};
({ firstNonStore, secondNonStore, thirdNonStore, fourthNonStore, $firstStore, $secondStore } = {
firstNonStore: 7,
secondNonStore: 8,
thirdNonStore: 9,
fourthNonStore: 11,
$firstStore: 10,
$secondStore: 12
});
</script>
<p>{firstNonStore}</p>
<p>{secondNonStore}</p>
<p>{thirdNonStore}</p>
<p>{$firstStore}</p>
<p>{fourthNonStore}</p>
<p>{$secondStore}</p>

@ -0,0 +1,10 @@
export default {
html: `
<p>7</p>
<p>8</p>
<p>9</p>
<p>10</p>
<p>11</p>
<p>12</p>
`
};

@ -0,0 +1,22 @@
<script>
import { writable } from 'svelte/store'
let { firstNonStore, secondNonStore, thirdNonStore, firstStore, fourthNonStore, secondStore } = {
firstNonStore: 1,
secondNonStore: 2,
thirdNonStore: 3,
firstStore: writable(4),
fourthNonStore: 5,
secondStore: writable(6)
};
([firstNonStore, secondNonStore, thirdNonStore, fourthNonStore, $firstStore, $secondStore] = [7, 8, 9, 11, 10, 12]);
</script>
<p>{firstNonStore}</p>
<p>{secondNonStore}</p>
<p>{thirdNonStore}</p>
<p>{$firstStore}</p>
<p>{fourthNonStore}</p>
<p>{$secondStore}</p>
Loading…
Cancel
Save