I have two promises that I am resolving with promise.all:
var mictest1 = new Promise((resolve, reject) => {
resolve(true);
});
var mictest2 = new Promise((resolve, reject) => {
resolve(true);
});
Promise.all([mictest1, mictest2]).then(data => {
console.log("test passed: " + data);
})
I would like to put the promises mictest1 and mictest2 into a function called mictest() so it does the following:
mictest();
Promise.all([mictest1, mictest2]).then(data => {
console.log("test passed: " + data);
})
In this way I can call the function at will, and when the promises get complicated, i don't have that block of text in front of promise.all
mictestto populate two global variables, mictest1 and mictest2, with promises? why?