Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 651 Bytes

no-on-calls-in-components.md

File metadata and controls

31 lines (22 loc) · 651 Bytes

ember/no-on-calls-in-components

💼 This rule is enabled in the ✅ recommended config.

Prevents using .on() in favour of component's lifecycle hooks.

The order of execution for on() is not deterministic.

Examples

Examples of incorrect code for this rule:

export default Component.extend({
  abc: on('didInsertElement', function () {
    /* custom logic */
  })
});

Examples of correct code for this rule:

export default Component.extend({
  didInsertElement() {
    /* custom logic */
  }
});