Skip to content

Instantly share code, notes, and snippets.

@nfons nfons/no-optimize.js

Created Jan 25, 2018
Embed
What would you like to do?
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
You can’t perform that action at this time.