Skip to content

Instantly share code, notes, and snippets.

@copperwall
Last active April 9, 2020 19:52
Show Gist options
  • Save copperwall/c8e9c5ff2b8f6be61da102c88a3dbc80 to your computer and use it in GitHub Desktop.
Save copperwall/c8e9c5ff2b8f6be61da102c88a3dbc80 to your computer and use it in GitHub Desktop.
function *sortOfAsyncFunction() {
const ivysaur = yield fetch('https://pokeapi.co/api/v2/pokemon/ivysaur');
return ivysaur.name.toUpperCase();
}
// "IVYSAUR"
runner(sortOfAsyncFunction).then(result => console.log(result));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment