async setMyPhotos() {
const newPhotos = await Promise.all(newPhotoPromises);
someOtherPromise();
syncAvatar(newPhotos[0], function(res, err) {
if (!err) console.log("avatar sync'd");
});
return newPhotos;
}
I noticed that it syncAvatarseems to work, but I'm not sure if I'm just lucky or not. If so, how can I make sure it syncAvataronly works after completion newPhotoPromises?
To clarify, it syncAvatarshould happen after execution newPhotoPromises, however, setMyPhotosyou just need to return the results newPhotoPromises, whereas it syncAvatarcan happen in the background.
kayla source
share