Возможна ли асинхронная рекурсия в моем случае? Как ее зациклить?
let newsData = await Promise.all(resArry.map(transform));
async function transform(body){
const par1 = body.par1
const par2 = body.par2
let arryReplies = []
return {
replies: await watchData(par1, par2)
}
async function watchData(arg1, arg2){
const response = await fetchData(arg1, arg2);
if(response.replies){ //???
arryReplies = [...await watchData(par1, response.par2), ...arryReplies] //???
return arryReplies //???
} //???
return response.replies
}
}