Created
July 13, 2018 19:06
-
-
Save sznowicki/3368e41636fe2f223b8f7ad771ecd178 to your computer and use it in GitHub Desktop.
Async...await vs promise - getting already resolve 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 p = new Promise((resolve) => resolve(1)); | |
p.then(r => console.log('promise', r)); | |
async function foo() { | |
const r = await p; | |
console.log('async', r); | |
} | |
foo(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment