clarify keyed each block tutorial

pull/8188/head
Jhorman Ruswel ㅠㅠ 4 years ago
parent 967e9f51ff
commit fcfa5e634c

@ -1,4 +1,6 @@
<script>
import { onDestroy } from 'svelte';
const emojis = {
apple: "🍎",
banana: "🍌",
@ -12,6 +14,11 @@
// ...but the "emoji" variable is fixed upon initialisation of the component
const emoji = emojis[name];
// when you remove first thing, it will remove items at the end of the block
onDestroy(() => {
console.log('thing destroyed: ' + name)
});
</script>
<p>

@ -1,4 +1,6 @@
<script>
import { onDestroy } from 'svelte';
const emojis = {
apple: "🍎",
banana: "🍌",
@ -12,6 +14,11 @@
// ...but the "emoji" variable is fixed upon initialisation of the component
const emoji = emojis[name];
// when you remove first thing, it will remove items at the end of the block
onDestroy(() => {
console.log('thing destroyed: ' + name)
});
</script>
<p>

Loading…
Cancel
Save