Created
September 2, 2017 01:20
-
-
Save patmigliaccio/15fe3bc3b0c881f5c16567af796af896 to your computer and use it in GitHub Desktop.
patmigliaccio.com/async-fishing 12/11/2016
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makeRequests(urls){ | |
let requests = urls.map(url => xhr({url: url, responseType: 'arraybuffer'})); | |
all(requests) | |
.then(response => { | |
response.forEach(value => { | |
if (value instanceof Error){ | |
console.error(value); | |
} | |
// Let's handle the value here. | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment