Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

run promise one by one

function runSerial(tasks) {
  var result = Promise.resolve();
  tasks.forEach(task => {
    result = result.then(() => task());
  });
  return result;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #run #promise
ADD COMMENT
Topic
Name
5+9 =