Skip to content

Instantly share code, notes, and snippets.

@priyankvex2
Created June 24, 2019 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save priyankvex2/3ad057fa89c76815ff921514c92f16fa to your computer and use it in GitHub Desktop.
Save priyankvex2/3ad057fa89c76815ff921514c92f16fa to your computer and use it in GitHub Desktop.
Pokemon Controller with hardcoded dependency
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