Answer the question
In order to leave comments, you need to log in
What's wrong with the async\await code?
There is a code:
let Load = (item, config) =>
{
return new Promise((resolve, reject) =>
{
let link = "URL";
Request.get(link, {timeout: 5 * second}, (err, response, body) =>
{
if(err)
{
reject(err);
}
else
{
resolve(body);
}
});
});
};
let AwaitLoad = async (item, config) =>
{
let result = await LoadSteamPrice(item, config);
console.log(result);
return result;
};
Info.forEach(item =>
{
let result = AwaitLoad(item, config);
console.log(result);
});
// далее должен быть еще код по обработке Info и всякого другого в синхронном порядке
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question