Last active
April 6, 2021 10:40
-
-
Save v-r/263672b3ce4a05b095649f511cab66cc to your computer and use it in GitHub Desktop.
async / await
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 calculate = async () => { | |
const val1 = await getValue(1) // remote call, will take 1 sec | |
const val2 = await getValue(2) // remote call, will take 1 sec | |
const val3 = await getValue(3) // remote call, will take 1 sec | |
// can i get answer faster than 3 seconds ? | |
return va1 + val2 + val3 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment