Skip to content

Commit 6ad3c56

Browse files
committed
update tutorial for keyed each blocks
1 parent c988457 commit 6ad3c56

File tree

1 file changed

+3
-1
lines changed
  • site/content/tutorial/04-logic/05-keyed-each-blocks

1 file changed

+3
-1
lines changed

site/content/tutorial/04-logic/05-keyed-each-blocks/text.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ To do that, we specify a unique identifier for the `each` block:
1414
{/each}
1515
```
1616

17-
The `(thing.id)` tells Svelte how to figure out what changed.
17+
The `(thing.id)` tells Svelte how to figure out what changed.
18+
19+
> You can use any object as the key, as Svelte uses a `Map` internally — in other words you could do `(thing)` instead of `(thing.id)`. Using a string or number is generally safer, however, since it means identity persists without referential equality, for example when updating with fresh data from an API server.

0 commit comments

Comments
 (0)