ember-cli / ember-cli/eslint-plugin-ember

Good practice to remove computed properties

Open
#1,093 0 comments 1 reaction 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
263
Forks
214
Avg merge
30m
Merged PRs (30d)
5

Description

I have the following code:

```javascript
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:

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

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.