Last active
March 7, 2017 07:34
-
-
Save toddzebert/ca9b735f1fbcd627ddfead4a87378adb to your computer and use it in GitHub Desktop.
"async" partial application functions for callback example; see https://gist.github.com/toddzebert/cee6d8b0475275be0f48d7dfef142bd3
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
// requires https://gist.github.com/toddzebert/95bcc9b50febad0bb9680d3eab897797 | |
// requires https://gist.github.com/toddzebert/b4465de41b0f8d317d7a685604983c36 | |
var getAuth = asyncSim.bind(null, 'Authorized'); | |
var getProfile = asyncSim.bind(null, 'Profile'); | |
var getFeed = asyncSim.bind(null, function(data) { | |
for (var a = [], i = randInt(4, 2); i; i--) { | |
a.push(randInt(90, 1)); | |
} | |
return a; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment