eslint-plugin-ember icon indicating copy to clipboard operation
eslint-plugin-ember copied to clipboard

Good practice to remove computed properties

Open alejandrodevs opened this issue 4 years ago • 0 comments

I have the following code:

import Component from '@glimmer/component';
import { alias } from '@ember/object/computed';
import { inject as service } from '@ember/service';

export default class AuthContainerComponent extends Component {
  @service tenant;
  @alias('tenant.company') currentCompany;
}

In order to stop using alias. I could use tenant.company directly in the template or add a getter like this:

get currentCompany() {
    return this.tenant.company;
  }

How are you migrating this? What is the good practice here?

alejandrodevs avatar Feb 23 '21 16:02 alejandrodevs