From 5ab4a6c2f8d188b42b4c8bb807a0610028dbd698 Mon Sep 17 00:00:00 2001 From: Emil Tholin Date: Fri, 26 Apr 2019 18:52:56 +0200 Subject: [PATCH 1/4] Fix typo in 10-transitions/07-local-transitions/text.md --- .../tutorial/10-transitions/07-local-transitions/text.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/content/tutorial/10-transitions/07-local-transitions/text.md b/site/content/tutorial/10-transitions/07-local-transitions/text.md index 7a22967ab0..400fbcaacb 100644 --- a/site/content/tutorial/10-transitions/07-local-transitions/text.md +++ b/site/content/tutorial/10-transitions/07-local-transitions/text.md @@ -4,7 +4,7 @@ title: Local transitions Ordinarily, transitions will play on elements when any container block is added or destroyed. In the example here, toggling the visibility of the entire list also applies transitions to individual list elements. -Instead, we'd like transitions to play only when individual items are added and removed — on other words, when the user drags the slider. +Instead, we'd like transitions to play only when individual items are added and removed — in other words, when the user drags the slider. We can achieve this with a *local* transition, which only plays when the immediate parent block is added or removed: @@ -12,4 +12,4 @@ We can achieve this with a *local* transition, which only plays when the immedia
{item}
-``` \ No newline at end of file +``` From cc4e5b3e31d2d1453f1130bf2bcbbe16597c1274 Mon Sep 17 00:00:00 2001 From: Luca Bonavita Date: Fri, 26 Apr 2019 18:36:05 +0100 Subject: [PATCH 2/4] Use comma as the separatore in the viewport content value. It seems that semicolon is not supported by Android phones. Problem is, we'll have to re-open #2551 as iOS doesn't support the comma... (eyeroll) --- site/src/template.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/template.html b/site/src/template.html index a3b79ae1e8..db0c7ae395 100644 --- a/site/src/template.html +++ b/site/src/template.html @@ -2,7 +2,7 @@ - + %sapper.base% From eab763c386902cb205901fad1807a115dd823172 Mon Sep 17 00:00:00 2001 From: Emil Tholin Date: Fri, 26 Apr 2019 21:55:42 +0200 Subject: [PATCH 3/4] Document how to remove a component.$on listener This PR documents how `component.$on` returns a function that removes the event listener when called. --- site/content/docs/03-run-time.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/site/content/docs/03-run-time.md b/site/content/docs/03-run-time.md index 843ac05e4c..0876cf3a36 100644 --- a/site/content/docs/03-run-time.md +++ b/site/content/docs/03-run-time.md @@ -573,10 +573,14 @@ component.$on(event, callback) Causes the `callback` function to be called whenever the component dispatches an `event`. +A function is returned that will remove the event listener when called. + ```js -app.$on('selected', event => { +const off = app.$on('selected', event => { console.log(event.detail.selection); }); + +off(); ``` #### `$destroy` From 1ba42435acecd86112d5bf594e399462377eecd5 Mon Sep 17 00:00:00 2001 From: Vidar Tysse Date: Sat, 27 Apr 2019 12:30:49 +0200 Subject: [PATCH 4/4] Typo --- site/content/tutorial/06-bindings/11-bind-this/text.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/content/tutorial/06-bindings/11-bind-this/text.md b/site/content/tutorial/06-bindings/11-bind-this/text.md index 25a7bc9169..e53b624057 100644 --- a/site/content/tutorial/06-bindings/11-bind-this/text.md +++ b/site/content/tutorial/06-bindings/11-bind-this/text.md @@ -2,7 +2,7 @@ title: This --- -The readonly `this` binding applies to every element (and component) and allows to you obtain a reference to rendered elements. For example, we can get a reference to a `` element: +The readonly `this` binding applies to every element (and component) and allows you to obtain a reference to rendered elements. For example, we can get a reference to a `` element: ```html ``` -Note that the value of `canvas` will be `undefined` until the component has mounted, so we put the logic inside the `onMount` [lifecycle function](tutorial/onmount). \ No newline at end of file +Note that the value of `canvas` will be `undefined` until the component has mounted, so we put the logic inside the `onMount` [lifecycle function](tutorial/onmount).