I use the request-promise
node module as following :
let rp = require('request-promise');
I have the following promises chain :
getData().then( data => {
return getUser(data);
})
.then( data => {
return getProfiles(data);
}).then( data => {
updateAddresses(data);
});
The updateAddresses
is as following :
function updateAddresses(data){
var promises = data.map( (aProfile) => {
var options = {url:'http://example.com', method:'POST'};
return rp(options);
});
// Promise.all(promises).then(...);
}
So I'm preparing a promise (request-promise) for each element of the array.
The problem is that those promises are firing even when I remove Promise.all
!
How is that possible ? How can I make the promise not firing ?
Regards.