From d8e625c439d775c762e3f57a8913c97cec92643f Mon Sep 17 00:00:00 2001 From: Jonathan Curran Date: Tue, 19 Nov 2019 17:49:46 +0100 Subject: [PATCH 1/2] Document $: in the tutorial This change re-words some of the prose so that the label syntax is spoken of in _unfamiliar_ terms rather than _alien_ as it is valid syntax and not some svelte-specific feature/functionality. --- .../tutorial/02-reactivity/02-reactive-declarations/text.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/content/tutorial/02-reactivity/02-reactive-declarations/text.md b/site/content/tutorial/02-reactivity/02-reactive-declarations/text.md index 365908cf22..849499ea17 100644 --- a/site/content/tutorial/02-reactivity/02-reactive-declarations/text.md +++ b/site/content/tutorial/02-reactivity/02-reactive-declarations/text.md @@ -11,7 +11,7 @@ let count = 0; $: doubled = count * 2; ``` -> Don't worry if this looks a little alien. It's valid (if unconventional) JavaScript, which Svelte interprets to mean 're-run this code whenever any of the referenced values change'. Once you get used to it, there's no going back. +> Don't worry if this looks unfamiliar. It's valid JavaScript, which Svelte interprets to mean 're-run this code whenever any of the referenced values change'. Once you get used to it, there's no going back. For those that are curious, `$:` is [label syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label). Let's use `doubled` in our markup: @@ -19,4 +19,4 @@ Let's use `doubled` in our markup:

{count} doubled is {doubled}

``` -Of course, you could just write `{count * 2}` in the markup instead — you don't have to use reactive values. Reactive values become particularly valuable when you need to reference them multiple times, or you have values that depend on *other* reactive values. \ No newline at end of file +Of course, you could just write `{count * 2}` in the markup instead — you don't have to use reactive values. Reactive values become particularly valuable when you need to reference them multiple times, or you have values that depend on *other* reactive values. From ae8684ffff94025c87588a4a128811a18f878da8 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Fri, 29 Nov 2019 21:11:44 -0500 Subject: [PATCH 2/2] Update text.md --- .../tutorial/02-reactivity/02-reactive-declarations/text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/content/tutorial/02-reactivity/02-reactive-declarations/text.md b/site/content/tutorial/02-reactivity/02-reactive-declarations/text.md index 849499ea17..027a91a44a 100644 --- a/site/content/tutorial/02-reactivity/02-reactive-declarations/text.md +++ b/site/content/tutorial/02-reactivity/02-reactive-declarations/text.md @@ -11,7 +11,7 @@ let count = 0; $: doubled = count * 2; ``` -> Don't worry if this looks unfamiliar. It's valid JavaScript, which Svelte interprets to mean 're-run this code whenever any of the referenced values change'. Once you get used to it, there's no going back. For those that are curious, `$:` is [label syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label). +> Don't worry if this looks a little alien. It's [valid](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label) (if unconventional) JavaScript, which Svelte interprets to mean 're-run this code whenever any of the referenced values change'. Once you get used to it, there's no going back. Let's use `doubled` in our markup: