Last active
January 7, 2019 21:48
-
-
Save thejohnfreeman/20c953cfb54177d75d5a836b6de1e4a4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const getFullName = async(function* (username, password) { | |
let token | |
try { | |
token = yield logIn(username, password); | |
} catch (error) { | |
console.error('wrong username or password') | |
return | |
} | |
const user = yield getUser(token) | |
return user.fullName | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment