Created
March 8, 2021 11:37
-
-
Save jaydson/85a5369865100b83a36e25b07f8107a4 to your computer and use it in GitHub Desktop.
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
function getAddress () { | |
return new Promise ((resolve, reject) =>{ | |
setTimeout(resolve, 2000); }); | |
} | |
function getUser () { | |
return new Promise((resolve, reject) =>{ | |
setTimeout(_=> resolve(getAddress()), 1000); | |
}); | |
} | |
getUser() | |
.then(result => console.log('Done')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment