From 7dc03f2a24f3cb705b14d940e0b48b9f2aa7c3c5 Mon Sep 17 00:00:00 2001 From: Frederic ST Date: Fri, 20 Jul 2018 13:16:04 +0200 Subject: [PATCH 1/5] Fix examples bug on writing-helpers.md --- guides/v3.2.0/templates/writing-helpers.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guides/v3.2.0/templates/writing-helpers.md b/guides/v3.2.0/templates/writing-helpers.md index 146b247c0d..6269f48606 100644 --- a/guides/v3.2.0/templates/writing-helpers.md +++ b/guides/v3.2.0/templates/writing-helpers.md @@ -159,7 +159,7 @@ to the helper function. Here is our example from above, updated to support the optional `sign` option: ```javascript {data-filename=app/helpers/format-currency.js} -export default helper(myHelper) +import { helper } from '@ember/component/helper'; export function formatCurrency([value, ...rest], namedArgs) { let dollars = Math.floor(value / 100); @@ -181,7 +181,7 @@ You can pass as many named arguments as you'd like. They get added to the ``` ```javascript {data-filename=app/helpers/my-helper.js} -export default helper(myHelper) +import { helper } from '@ember/component/helper'; export function myHelper(params, namedArgs) { console.log(namedArgs.option1); // => "hello" @@ -196,7 +196,7 @@ You can use JavaScript's destructuring assignment shorthand in this case as well to clean up the above code: ```javascript {data-filename=app/helpers/my-helper.js} -export default helper(myHelper) +import { helper } from '@ember/component/helper'; export function myHelper(params, { option1, option2, option3 }) { console.log(option1); // => "hello" From c9c96d323033a19ceed6da3f51d25c5bef70194e Mon Sep 17 00:00:00 2001 From: Frederic ST Date: Mon, 23 Jul 2018 10:04:46 +0200 Subject: [PATCH 2/5] Update writing-helpers.md --- guides/v3.3.0/templates/writing-helpers.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/guides/v3.3.0/templates/writing-helpers.md b/guides/v3.3.0/templates/writing-helpers.md index 146b247c0d..8e05fdbafd 100644 --- a/guides/v3.3.0/templates/writing-helpers.md +++ b/guides/v3.3.0/templates/writing-helpers.md @@ -159,7 +159,7 @@ to the helper function. Here is our example from above, updated to support the optional `sign` option: ```javascript {data-filename=app/helpers/format-currency.js} -export default helper(myHelper) +import { helper } from '@ember/component/helper'; export function formatCurrency([value, ...rest], namedArgs) { let dollars = Math.floor(value / 100); @@ -181,7 +181,7 @@ You can pass as many named arguments as you'd like. They get added to the ``` ```javascript {data-filename=app/helpers/my-helper.js} -export default helper(myHelper) +import { helper } from '@ember/component/helper'; export function myHelper(params, namedArgs) { console.log(namedArgs.option1); // => "hello" @@ -189,14 +189,14 @@ export function myHelper(params, namedArgs) { console.log(namedArgs.option3); // => "goodbye cruel world" }); -export default helper(myHelper) +export default helper(myHelper); ``` You can use JavaScript's destructuring assignment shorthand in this case as well to clean up the above code: ```javascript {data-filename=app/helpers/my-helper.js} -export default helper(myHelper) +import { helper } from '@ember/component/helper'; export function myHelper(params, { option1, option2, option3 }) { console.log(option1); // => "hello" From 43383193aeb43cf0dca7d4ba0f1f79624040fc75 Mon Sep 17 00:00:00 2001 From: Frederic ST Date: Mon, 23 Jul 2018 10:08:44 +0200 Subject: [PATCH 3/5] Update writing-helpers.md --- guides/v3.2.0/templates/writing-helpers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/v3.2.0/templates/writing-helpers.md b/guides/v3.2.0/templates/writing-helpers.md index 6269f48606..8e05fdbafd 100644 --- a/guides/v3.2.0/templates/writing-helpers.md +++ b/guides/v3.2.0/templates/writing-helpers.md @@ -189,7 +189,7 @@ export function myHelper(params, namedArgs) { console.log(namedArgs.option3); // => "goodbye cruel world" }); -export default helper(myHelper) +export default helper(myHelper); ``` You can use JavaScript's destructuring assignment shorthand in this case From d1948d2c1cad9272830fc0fc933ab490c14e9df7 Mon Sep 17 00:00:00 2001 From: Frederic ST Date: Mon, 23 Jul 2018 10:10:30 +0200 Subject: [PATCH 4/5] Update writing-helpers.md --- guides/v3.1.0/templates/writing-helpers.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/guides/v3.1.0/templates/writing-helpers.md b/guides/v3.1.0/templates/writing-helpers.md index 146b247c0d..8e05fdbafd 100644 --- a/guides/v3.1.0/templates/writing-helpers.md +++ b/guides/v3.1.0/templates/writing-helpers.md @@ -159,7 +159,7 @@ to the helper function. Here is our example from above, updated to support the optional `sign` option: ```javascript {data-filename=app/helpers/format-currency.js} -export default helper(myHelper) +import { helper } from '@ember/component/helper'; export function formatCurrency([value, ...rest], namedArgs) { let dollars = Math.floor(value / 100); @@ -181,7 +181,7 @@ You can pass as many named arguments as you'd like. They get added to the ``` ```javascript {data-filename=app/helpers/my-helper.js} -export default helper(myHelper) +import { helper } from '@ember/component/helper'; export function myHelper(params, namedArgs) { console.log(namedArgs.option1); // => "hello" @@ -189,14 +189,14 @@ export function myHelper(params, namedArgs) { console.log(namedArgs.option3); // => "goodbye cruel world" }); -export default helper(myHelper) +export default helper(myHelper); ``` You can use JavaScript's destructuring assignment shorthand in this case as well to clean up the above code: ```javascript {data-filename=app/helpers/my-helper.js} -export default helper(myHelper) +import { helper } from '@ember/component/helper'; export function myHelper(params, { option1, option2, option3 }) { console.log(option1); // => "hello" From 597e6a4a40b639f1691b211c2aa51f93b12e421f Mon Sep 17 00:00:00 2001 From: Frederic ST Date: Mon, 23 Jul 2018 10:11:18 +0200 Subject: [PATCH 5/5] Update writing-helpers.md --- guides/v3.0.0/templates/writing-helpers.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/guides/v3.0.0/templates/writing-helpers.md b/guides/v3.0.0/templates/writing-helpers.md index fce7152c52..ecb759960a 100644 --- a/guides/v3.0.0/templates/writing-helpers.md +++ b/guides/v3.0.0/templates/writing-helpers.md @@ -159,7 +159,7 @@ to the helper function. Here is our example from above, updated to support the optional `sign` option: ```javascript {data-filename=app/helpers/format-currency.js} -export default helper(myHelper) +import { helper } from '@ember/component/helper'; export function formatCurrency([value, ...rest], namedArgs) { let dollars = Math.floor(value / 100); @@ -181,7 +181,7 @@ You can pass as many named arguments as you'd like. They get added to the ``` ```javascript {data-filename=app/helpers/my-helper.js} -export default helper(myHelper) +import { helper } from '@ember/component/helper'; export function myHelper(params, namedArgs) { console.log(namedArgs.option1); // => "hello" @@ -189,14 +189,14 @@ export function myHelper(params, namedArgs) { console.log(namedArgs.option3); // => "goodbye cruel world" }); -export default helper(myHelper) +export default helper(myHelper); ``` You can use JavaScript's destructuring assignment shorthand in this case as well to clean up the above code: ```javascript {data-filename=app/helpers/my-helper.js} -export default helper(myHelper) +import { helper } from '@ember/component/helper'; export function myHelper(params, { option1, option2, option3 }) { console.log(option1); // => "hello"