💼 This rule is enabled in the ✅ recommended
config.
Always use closure actions (according to DDAU convention). Exception: only when you need bubbling.
export default Controller.extend({
actions: {
detonate() {
alert('Kabooom');
}
}
});
Examples of incorrect code for this rule:
// awful-component.js
export default Component.extend({
actions: {
pushLever() {
this.sendAction('detonate');
}
}
});
Examples of correct code for this rule:
// pretty-component.js
export default Component.extend({
actions: {
pushLever() {
this.boom();
}
}
});
- RFC to deprecate
sendAction