Skip to content

Instantly share code, notes, and snippets.

@toddzebert
Last active March 7, 2017 07:34
Show Gist options
  • Save toddzebert/ca9b735f1fbcd627ddfead4a87378adb to your computer and use it in GitHub Desktop.
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
// 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