Created
July 20, 2019 21:34
-
-
Save mlevkovsky/17a768152f2ca13962fab1c1a05a13b9 to your computer and use it in GitHub Desktop.
redundant variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getBackgroundArt(track: Track): BackgroundImage { | |
switch(track.getGenre()) { | |
case "hiphop": | |
const hipHopImage: BackgroundImage = {dimension: 'small', 'url': 'https://unsplash.com/photos/Qcl98B8Bk3I'}; | |
return hipHopImage; | |
case "jazz": | |
const jazzImage : BackgroundImage = {dimension: 'small', 'url': 'https://unsplash.com/photos/dBWvUqBoOU8'}; | |
return jazzImage; | |
case "rap": | |
const rapImage : BackgroundImage = {dimension: 'small', 'url': 'https://unsplash.com/photos/auq_QbyIA34'}; | |
return rapImage; | |
case "country": | |
const countryImage: BackgroundImage = {dimension: 'small', 'url': 'https://unsplash.com/photos/RnFgs90NEHY'}; | |
return countryImage; | |
default: | |
const defaultImage: BackgroundImage = {dimension: 'small', 'url': 'https://unsplash.com/photos/PDX_a_82obo'}; | |
return defaultImage; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getBackgroundArt(track: Track): BackgroundImage { | |
let backgroundImage: BackgroundImage; | |
switch(track.getGenre()) { | |
case "hiphop": | |
backgroundImage = {dimension: 'small', 'url': 'https://unsplash.com/photos/Qcl98B8Bk3I'}; | |
break; | |
case "jazz": | |
backgroundImage = {dimension: 'small', 'url': 'https://unsplash.com/photos/dBWvUqBoOU8'}; | |
break; | |
case "rap": | |
backgroundImage = {dimension: 'small', 'url': 'https://unsplash.com/photos/auq_QbyIA34'}; | |
break; | |
case "country": | |
backgroundImage = {dimension: 'small', 'url': 'https://unsplash.com/photos/RnFgs90NEHY'}; | |
break; | |
default: | |
backgroundImage = {dimension: 'small', url : 'https://unsplash.com/photos/PDX_a_82obo'}; | |
} | |
return backgroundImage; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment