Skip to content

Instantly share code, notes, and snippets.

@AndrewGaspar
Created October 4, 2013 10:52
Show Gist options
  • Save AndrewGaspar/6824176 to your computer and use it in GitHub Desktop.
Save AndrewGaspar/6824176 to your computer and use it in GitHub Desktop.
Promises
var queryResultsPromise = readListOfQueriesAsync("config.xml")
.then(function(queries) {
return promise.all(
queries.map(searchQueryAsync)
);
}).then(function(queryResults) {
return writeOutAsync(queryResults);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment