Skip to content

Instantly share code, notes, and snippets.

@caasi
Last active August 18, 2018 16:31
Show Gist options
  • Save caasi/e6aa816ee87e5095ab19daae776899b5 to your computer and use it in GitHub Desktop.
Save caasi/e6aa816ee87e5095ab19daae776899b5 to your computer and use it in GitHub Desktop.
verfyRecap()
    .then((response) => {
      console.log(response.data);
      if (....) {
        doSomeThingSync();
      }
    })
    .catch((error) => {
      .....
      console.log(error);
    })
    .then(() => {
      return scanEmail(.....);
    })
    .then((data) => {
      ......;
    }
async function func() {
try {
const response = await verfyRecap();
console.log(response.data);
if (....) {
doSomeThingSync();
}
} catch (error) {
console.log(error)
}
  const data = await scanEmail(.....);
  .....;
}
function func$(next) {
verfyRecap(function(err, response) {
if (err) console.log(err);
console.log(response.data);
if (....) { doSomeThingSync(); }
scanEmail(function(err, data) {
if (err) return next(err);
.....;
next();
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment