vendredi 8 février 2019

Should I always include this._super(...arguments) when overwriting an Ember member function

In Ember.js, there are a lot of functions that require you to call this._Super(...arguments) before calling them. A quick example from the documentation:

import Component from '@ember/component';

export default Component.extend({
  didRender() {
    this._super(...arguments);
    console.log('I rendered!');
  }
});

Are there ever cases in Ember where we do not need to call this._super()? The reason I ask is because often times, I will write some hooks for either my controllers or routes where I simply forget to call this._super(...arguments) and, as far as I can tell, everything works the same.

Should I always include a super() method before overwriting any member function in Ember?




Aucun commentaire:

Enregistrer un commentaire