Last active
January 7, 2017 10:58
-
-
Save panetta-net-au/c68fe9fcdc0de93c1e3d51099de45573 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
//Example only. This won't work if keys and results are different lengths. | |
function batchLoad(keys) { | |
var results = databaseClient.get(keys); | |
var orderedResults = []; | |
for (var i=0; i < keys.length; i++) { | |
orderedResults.push(results.filter(r => r.id == keys[i])[0]); | |
} | |
return orderedResults; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment