Skip to content

Instantly share code, notes, and snippets.

@nfons
Created January 25, 2018 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nfons/c54449e587cd6d970bb4acff24e44f4a to your computer and use it in GitHub Desktop.
Save nfons/c54449e587cd6d970bb4acff24e44f4a to your computer and use it in GitHub Desktop.
var syncDep;
/**
assume this is a expensive(ish) HTTP call.
*/
function getLottery() {
return new Promise((resolve, reject) =>{
setTimeout(function() {
syncDep = [1,22,34,56,5];
resolve(syncDep);
}, 2000);
});
}
exports.handler = function(context, event, callback) {
getLottery().then(numbers =>{
callback(null,numbers);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment