arrays - Nativescript multiple fetch http post -


i'm facing little problem. how should make looping post (arrays of data) need send 1 one waiting earlier post response before sending one. ideas welcome!

i'm using newest nativescript , stock fetch module.

sounds recursive call me, like:

function postdata(arr, index){  let itemtopost = arr[index];  fetch('https://xyz/some/url', {     method: 'post'     content: json.stringify(itemtopost)//   }).then(function(response) { //success      //recursive call here      postdata(arr, ++index)  }).catch(function(err) {     // error :( }); } 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -