Created
May 29, 2014 19:53
-
-
Save veltman/fcb6d1bd7aed8438aeff to your computer and use it in GitHub Desktop.
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
queue() | |
.defer(getJSON,"new-york.json") | |
.defer(getJSON,"chicago.json") | |
.defer(getJSON,"miami.json") | |
.awaitAll(function(error,cities) { | |
//Cities will be an array of cities, in order | |
}); | |
function getJSON(url,cb) { | |
$.getJSON(url,function(data) { | |
cb(null,data); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment