Closed nioperas06 closed 6 years ago
On pourrait réduire ce code:
public bookFactory(item: any): Book { return new Book( item.id, item.volumeInfo.title, item.volumeInfo.subtitle, item.volumeInfo.authors, item.volumeInfo.publisher, item.volumeInfo.publishedDate, item.volumeInfo.description, item.volumeInfo.categories ? item.volumeInfo.categories.map((item) => item.split("/").pop().trim()) : ['N/A'], item.volumeInfo.imageLinks.thumbnail, item.volumeInfo.imageLinks.smallThumbnail ) }
et le déplacer dans le constructeur de la classe Book. Des idées?
On pourrait réduire ce code:
et le déplacer dans le constructeur de la classe Book. Des idées?