From ec3d245fc401e55a706a3920c154694c6f138112 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 529cf5c963831ef31e3205f6e42b02f30ea86746 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 800b2db4e61251741f5b65019ad20b010d30225b 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 83bbe5674b6b800546678d21553c5bfe4902af59 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).