-
Notifications
You must be signed in to change notification settings - Fork 0
March 7th, 2018
Chandler McWilliams edited this page Mar 10, 2018
·
2 revisions
(Fetch)
function timeout(duration = 0) {
return new Promise((resolve, reject) => {
setTimeout(resolve, duration);
})
}
var p = timeout(1000).then(() => {
return timeout(2000);
}).then(() => {
throw new Error("hmm");
}).catch(err => {
return Promise.all([timeout(100), timeout(200)]);
})