eslint-plugin-ember
Version:
Eslint plugin for Ember.js apps
44 lines (38 loc) • 654 B
Markdown
## Closure Actions
### Rule name: `closure-actions`
Always use closure actions (according to DDAU convention). Exception: only when you need bubbling.
```javascript
export default Controller.extend({
actions: {
detonate() {
alert('Kabooom');
}
}
});
```
```hbs
{{! GOOD }}
{{pretty-component boom=(action 'detonate')}}
```
```javascript
export default Component.extend({
actions: {
pushLever() {
this.boom();
}
}
})
```
```hbs
{{! BAD }}
{{awful-component detonate='detonate'}}
```
```javascript
export default Component.extend({
actions: {
pushLever() {
this.sendAction('detonate');
}
}
})
```