Function

Available since v1.13.0

helper
Function
The helper function

In many cases it is not necessary to use the full Helper class. The helper method create pure-function helpers without instances. For example:

currency.js
1
2
3
4
5
import { helper } from '@ember/component/helper';

export default helper(function([cents], {currency}) {
  return `${currency}${cents * 0.01}`;
});