Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229111

How do I make http.get requests sequential?

$
0
0

hi
create array of promises to the function u want to download in series then:

let promisesArray=[];
downloadinSeries(promisesArray).then(() => {

        }).catch((error) => {
            console.log(error);
        });

downloadinSeries(arr) {
return arr.reduce(function (promise, item) {
return promise.then(function (result) {
return item();
});
}, Promise.resolve([]));
}


Viewing all articles
Browse latest Browse all 229111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>