-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
collection/src/app/shared/components/search/scripts/search.js
Lines 49 to 80 in fc2f42d
| handleMovieData(movieData, bookData, albumData, comicData) { | |
| console.log('movieData: ', movieData); | |
| this.renderSearchFilmTemplate( | |
| movieData.Poster, | |
| movieData.Title, | |
| movieData.Rated, | |
| movieData.Genre, | |
| movieData.Runtime, | |
| movieData.Plot, | |
| movieData.Director, | |
| movieData.Writer, | |
| movieData.Actors, | |
| movieData.Year | |
| ); | |
| console.log('bookData: ', bookData); | |
| this.renderSearchBookTemplate( | |
| bookData.items[0].volumeInfo.title, | |
| bookData.items[0].volumeInfo.imageLinks.thumbnail, | |
| bookData.items[0].volumeInfo.authors, | |
| bookData.items[0].volumeInfo.categories, | |
| bookData.items[0].volumeInfo.ratingsCount, | |
| bookData.items[0].volumeInfo.pageCount, | |
| bookData.items[0].volumeInfo.publishedDate | |
| ); | |
| console.log('albumData: ', albumData); | |
| this.renderSearchAlbumTemplate( | |
| albumData.results[1].title, | |
| albumData.results[1].cover_image | |
| //albumData.results[0].artist, | |
| ); | |
| console.log('comicData: ', comicData); | |
| } |
This should actually be the last method (except for the render method) in this class. Try and extract the respective render logic into its own place (class, function, ...) and import that. This way, this class does not have to know about the how (check out Law of Demeter, Single Responsibility Principle)...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels