You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am absolutely baffled on how to use this client in a do..while loop. It appears the client does an async call, but I cannot seem to get it to await response before continuing.
asyncfunctiontest(){letdoMore=true;do{letendpoint=`${share_api}/test/search/scopes/conceptId?start=${start}&pageSize=${pageSize}`;console.log(`Retrieving from ${endpoint}...`);letoldStart=start;awaitclient.get(endpoint,args,(data,response)=>{letvalues=data.values;lettotal=data.total;// values.forEach(value => {// console.log(value);// });console.log(`Received ${values.length} result(s).`);doMore=data.hasMore;start+=pageSize;}).on("error",function(err){console.log("Something went wrong on the request",err.request.options);doMore=false;});doMore=oldStart<start;console.log("Got here.");}while(doMore);}
The text was updated successfully, but these errors were encountered:
asyncfunctiontest(){while(condition){try{awaitpromisify();}catch{..}}}functionpromisify(){returnnewPromise((resolve,reject)=>{client.get(params,(data,response)=>{// do stuffresolve();}).on('err',reject);}}
I am absolutely baffled on how to use this client in a do..while loop. It appears the client does an async call, but I cannot seem to get it to await response before continuing.
The text was updated successfully, but these errors were encountered: