I think your examples could be simplified:
export default function getUsers () {
return getUsersFromDB()
.then(filterUsersWithFriends)
.then(getUsersLikes);
}
And there's just about never a reason to use the `Promise` constructor in real world code. If you already have a promise as in your example, so you can rewrite your refactoring as: export default function getUsers () {
return getUsersFromDB()
.then(users => filterUsersWithFriends(users).catch(err => trySomethingElse(users)));
}