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

You're still nesting. Considering the whole point the author made was that something went wrong with `filterUsersWithFriends`, then you would simply handle that in the next `.then`... So something like:

  export default function getUsers () {
    return getUsers()
      .then(users => filterUsersWithFriends)
      .then(getUsersLikes, trySomethingElse);
  }
would have been more than enough.



I think the problem with your solution is that trySomethingElse won't have access to the users variable unless the filterUsersWithFriends rejection explicitly passes it through.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: