Skip to content

Instantly share code, notes, and snippets.

@silesky
Last active October 10, 2017 18:12
Show Gist options
  • Save silesky/84eeccb859ac1c14372f3903da0e991b to your computer and use it in GitHub Desktop.
Save silesky/84eeccb859ac1c14372f3903da0e991b to your computer and use it in GitHub Desktop.
blog_async_getData
getDataFromDb()
.then(res => getDataFromAPI(res.id))
.then(data => getUserDataFromAPI2(data.userToken)})
.then(userData => {
if (!userData) throw;
return someMachineLearningAPI(userData.Image)
})
.then(imageUri => {
document.getElementById('myImage').src = imageUri
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment