Fazendo promessas
new Promise((resolve, reject) => {
if (ok) { resolve(result) }
else { reject(error) }
})
Motionless Mallard
new Promise((resolve, reject) => {
if (ok) { resolve(result) }
else { reject(error) }
})