I was testing node-fetch and when I was using async / await, a question came up : I have to make my function async if I use await in it BUT since my function is async I need to await it and make the parent function async. And so on... Context :
async functionA()
{
var result = await functionB();
}
async functionB()
{
//do things
var result = await functionC();
//do things
var blob;
//do things
return blop;
}
async functionC()
{
//here is the real async call
var result = await fetch(....);
var json = await result.json();
return json;
}
}
How can I make this async / await chaining stop ? I have one method in my program using fetch and it will make me transform all my others methods to async method. Is this really how all others program developped with fetch look like ? Perhaps I didn't understand something with async/ await.
Thanks for your time :)