Promise.all() designed to work in parallel, when you run a bunch of asynchronous operations to run at the same time, and then it tells you when everything is done.
He does not in any way rebuild either one or the other. Thus, you cannot use it to wait until the user is ready, and then other operations will be used by this user. It is simply not intended for this.
First, you can get the user, and then when this is completed, you can use Promise.all() with two other operations, which, I think, can be performed simultaneously and are independent of each other.
var user; someService.getUsername().then(function(username) { user = username; return Promise.all(getUserProps(user), getUserFriends(user)); }).then(function() {
source share