Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 403 Bytes

File metadata and controls

17 lines (12 loc) · 403 Bytes

Don't use .on() calls as components values

Rule name: no-on-calls-in-components

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

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

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

  // GOOD
  didInsertElement() { /* custom logic */ }
});