Skip to content

Instantly share code, notes, and snippets.

@patmigliaccio
Created September 2, 2017 01:20
Show Gist options
  • Save patmigliaccio/15fe3bc3b0c881f5c16567af796af896 to your computer and use it in GitHub Desktop.
Save patmigliaccio/15fe3bc3b0c881f5c16567af796af896 to your computer and use it in GitHub Desktop.
patmigliaccio.com/async-fishing 12/11/2016
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