Skip to content

Instantly share code, notes, and snippets.

@khaosdoctor
Last active April 7, 2019 22:58
Show Gist options
  • Save khaosdoctor/90c989674c98a1d63acb9a5ce1809ae7 to your computer and use it in GitHub Desktop.
Save khaosdoctor/90c989674c98a1d63acb9a5ce1809ae7 to your computer and use it in GitHub Desktop.
const p = new Promise((resolve, reject) => {
setTimeout(() => resolve('yay'), 5000)
})
// Ambos os callbacks estão ligados a p
p.then((res) => {}, (rej) => {})
// Isto aqui é a mesma coisa
new Promise((resolve, reject) => {})
.then((res) => {}, (rej) => {})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment