Created
June 30, 2017 18:55
-
-
Save sogoiii/cdfbcba5d7e678a7cbaff3b97bef7ae6 to your computer and use it in GitHub Desktop.
Async returns a promise
This file contains 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 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