Hacker News new | past | comments | ask | show | jobs | submit login

Async structures aren't always availablein every environment. Take JS for instance.

Without ES6 and Babel, what's the way to write if statements with async?

  if (x) {
    _afterX(null, x);
  } else {
    getX(_afterX);
  }
  function _afterX(err, x) {
    if (err) return;
    // use x
  }
  // do stuff that doesn't depend on x



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: