ember-learn / ember-learn/guides-source
Give other (more important reason) for refactoring code in Super Rentals tutorial
- Dominant language
- HTML
- Stars
- 161
- Forks
- 512
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 4
Description
In the Super Rental tutorial, [Part 1, Interactive Components](https://guides.emberjs.com/release/tutorial/part-1/interactive-components/#toc_testing-user-interactions) it is suggested that this code
```hbs
{{#if this.isLarge}}
View Smaller
{{else}}
View Larger
{{/if}}
```
be refactored into this code
```hbs
View {{if this.isLarge "Small" "Large"}}
```
the main reason given is code readability but in my opinion the use of the same image element, without removing one and creating another, is much more important, as when you use the first example the image loads each time isLarge is changed, causing a much worst user experience. This is a very important reason for refactoring that, in my opinion, should be outlined in the guide.
Contributor guide
Assessment
This issue has not been assessed yet.