Skip to content

Instantly share code, notes, and snippets.

@sogoiii
Created June 30, 2017 18:55
Show Gist options
  • Save sogoiii/cdfbcba5d7e678a7cbaff3b97bef7ae6 to your computer and use it in GitHub Desktop.
Save sogoiii/cdfbcba5d7e678a7cbaff3b97bef7ae6 to your computer and use it in GitHub Desktop.
Async returns a promise
const operationOne = function async (data) {
let step1 = await somePromise(data)
let step2 = await anotherPromise(step1)
return step2.data
}
actionOne()
.then(operationOne)
.then(data => {
//more work
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment