Use plain functions as helpers. Polyfill for RFC: 756 | Default Helper Manager
- Ember.js v3.25 or above
- Ember CLI v3.25 or above
- ember-auto-import v1 or above
ember install ember-functions-as-helper-polyfill
Define a function (doesn't have to be in a component)
import Component from '@glimmer/component';
export default class MyComponent extends Component {
myHelper = x => x * 2;
}
Named arguments will all be grouped together in the last argument of the helper:
import Component from '@glimmer/component';
export default class MyComponent extends Component {
doStuff = (x, options) => {
console.log(x, options.optionA, options.optionB);
};
}
See the Contributing guide for details.
This project is licensed under the MIT License.