Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Ember on codemod

To conform to this linting rule, this codemod will replace uses of Ember.on with their method equivalent.

Changes

willChange

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

will become

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

wontChange

non-lifecycle events

export default Ember.Component.extend({
  onSomething: Ember.on('something', function() {

  }),
});

initted observers

cos probably done for a reason and observer needs manual refactoring and proper testing

export default Ember.Component.extend({
  a: Ember.on('init', Ember.observer('something', function() {

  })),
});

with params

soon to be deprecated, should remain as a linting error until refactored

export default Ember.Component.extend({
  onDidReceiveAttrs: Ember.on('didReceiveAttrs', function({ newAttrs, oldAttrs }) {

  }),
});

Releases

No releases published

Packages

No packages published