Created
September 25, 2017 12:46
-
-
Save coelhoadler/8dd370cfc596fbd15aba8e2cfbe9e769 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 async() { | |
| return new Promise( (resolve, reject) => { | |
| setTimeout(() => { | |
| resolve({'message' : 'deu certo'}); | |
| }, 2000) | |
| }); | |
| } | |
| function noAsync() { | |
| console.log('Função não assíncrona.') | |
| } | |
| // | |
| async().then((data) => { | |
| console.info(data); | |
| }) | |
| noAsync(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment