Skip to content

Instantly share code, notes, and snippets.

@tygas
Created September 7, 2017 13:16
Show Gist options
  • Save tygas/0cd1a40fc7cf20efc32ecf0018a1e3b9 to your computer and use it in GitHub Desktop.
Save tygas/0cd1a40fc7cf20efc32ecf0018a1e3b9 to your computer and use it in GitHub Desktop.
let r;
const runTasks = (...tasks) => Promise.all(tasks.map(t => {
"use strict";
debugger;
})).then((r)=> {
console.log(r);
return r;
})
const tA = () => new Promise(r => setTimeout(()=> r('A'), 1000))
const tB = () => new Promise(r => setTimeout(()=> r('B'), 100))
const tC = () => new Promise(r => setTimeout(()=> r('C'), 100))
r = runTasks(tA, tB, tC);
//https://docs.google.com/a/adapt.dk/forms/d/e/1FAIpQLSeii7bf8I8TKTai7r6IqVc1FvfONCQ1Bxz0LZ8AWqd8XF_FDg/formResponse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment