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