« first day (2619 days earlier)      last day (1483 days later) » 

 
2 hours later…
12:34 PM
@KarelG @JeffreySweeney
function getSSNdetails() {
setTimeout(() => {
return axios.get('http://localhost:5000/one');
}, 2000);
}

function getmobileResult() {
setTimeout(() => {
return axios.get('http://localhost:5000/two');
}, 2000);
}

try {
axios.all([getNICdetails(), getPTAResult()]).then(
axios.spread(function(nic, pta) {
console.log(nic.data);
console.log(pta.data);
})
);
return 'Success';
} catch (error) {
return error;
}
}
 
1 message moved from JavaScript
 
You shouldn't need to put them in a timeout. Axios returns promises right (don't remember)? Just calling them should do the trick.
axios.get('localhost:5000/one');
axios.get('localhost:5000/two');

If you wanted a delay you could make the function async/await, or use Promise.all like this:
Promise.all([
axios.get('localhost:5000/one'),
axios.get('localhost:5000/two')
]).then(() => { ... })
 
1 message moved from JavaScript
1 message moved from JavaScript
 
 
5 hours later…
A K
6:10 PM
to be specific

function a() {
b()
}

function b() {
console.log('parent') // will log a
}
 
1 message moved from JavaScript
 

« first day (2619 days earlier)      last day (1483 days later) »