Last active
January 20, 2017 16:21
-
-
Save hotohoto/2f5746b4ade7984f832b256a900d3aa5 to your computer and use it in GitHub Desktop.
A simple async await example
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 test = () => new Promise((resolve, reject) => { | |
setTimeout(() => { | |
return resolve('hi') | |
}, 100) | |
}) | |
const doTest = async () => { | |
const ret = await test() | |
console.log(ret) | |
} | |
doTest() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment