Skip to content

Instantly share code, notes, and snippets.

@coelhoadler
Created September 25, 2017 12:46
Show Gist options
  • Select an option

  • Save coelhoadler/8dd370cfc596fbd15aba8e2cfbe9e769 to your computer and use it in GitHub Desktop.

Select an option

Save coelhoadler/8dd370cfc596fbd15aba8e2cfbe9e769 to your computer and use it in GitHub Desktop.
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