Skip to content

Commit 489121f

Browse files
committed
Fix typos on date and example in latest blog post
1 parent a58a14e commit 489121f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

content/plain-old-functions-as-helpers.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Plain Old Functions as Helpers
33
authors:
44
- chris-krycho
5-
date: 2022-08-09T13:30:00.000Z
5+
date: 2022-08-04T13:30:00.000Z
66
tags:
77
- '2022'
88
- announcement
@@ -80,6 +80,7 @@ We’ll have more to say on that in the future!
8080
Instead of writing `helper(function(pos, named) { ... })` you can define a function normally and make it the default export from a file in your app or addon's `helpers` directory. For example, here’s how you might have defined a `parse-int` helper before:
8181

8282
```js
83+
// app/helpers/parse-int.js
8384
import { helper } from '@ember/component/helper';
8485

8586
export default helper(function parseInt([numberToParse], { radix = 10 }) {
@@ -90,8 +91,9 @@ export default helper(function parseInt([numberToParse], { radix = 10 }) {
9091
Here's how we would define that now that we have the ability to use normal functions as helpers:
9192

9293
```js
94+
// app/helpers/parse-int.js
9395
export default function parseInt(numberToParse, { radix = 10 }) {
94-
// ...
96+
return Number.parseInt(numberToParse, radix);
9597
}
9698
```
9799

0 commit comments

Comments
 (0)