Answers for "use then with promise.all"

0

how to use promise.all

const contentPromise = requestUser();
 const commentsPromise = requestComments();

 const combinedContent = Promise.all([contentPromise, commentsPromise])
   .then(([content, comments]) => {
     // content and comments have both finished loading.
   })
Posted by: Guest on October-28-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language