From d2d800a79968032ed558a9af4f13532920d4679f Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Wed, 17 Apr 2019 09:12:13 -0400 Subject: [PATCH] update tutorial for keyed each blocks --- site/content/tutorial/04-logic/05-keyed-each-blocks/text.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/site/content/tutorial/04-logic/05-keyed-each-blocks/text.md b/site/content/tutorial/04-logic/05-keyed-each-blocks/text.md index d0dec628b6..e8bac7d8df 100644 --- a/site/content/tutorial/04-logic/05-keyed-each-blocks/text.md +++ b/site/content/tutorial/04-logic/05-keyed-each-blocks/text.md @@ -14,4 +14,6 @@ To do that, we specify a unique identifier for the `each` block: {/each} ``` -The `(thing.id)` tells Svelte how to figure out what changed. \ No newline at end of file +The `(thing.id)` tells Svelte how to figure out what changed. + +> 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. \ No newline at end of file