Created
June 24, 2019 07:14
-
-
Save priyankvex2/3ad057fa89c76815ff921514c92f16fa to your computer and use it in GitHub Desktop.
Pokemon Controller with hardcoded dependency
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
let pokemon_db_layer = require('./pokemon_db_layer'); | |
function getPokemonProfile(pokemonId){ | |
let pokemonObj = pokemon_db_layer.findById(pokemonId); | |
return { | |
name: pokemonObj ? pokemonObj.name : "", | |
level: pokemonObj ? pokemonObj.level : "" | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment