Created
July 28, 2016 09:12
-
-
Save peterjuras/49344df648408ca880b932460d9c8531 to your computer and use it in GitHub Desktop.
Azure Functions Promise test
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
// Version A | |
module.exports = function(context) { | |
var urls = []; | |
if (urls.length === 0) { | |
context.done(); | |
} | |
} | |
// Version B | |
module.exports = function(context) { | |
var urls = []; | |
// Promise.all([]) should resolve immediately with an empty array! | |
// https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise/all | |
Promise.all(urls).then(() => context.done()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment