Depending on a certain condition x, I need to perform a redirect either right now or after a promise asyncFunction resolved:
if (x) {
await asyncFunction();
redirectToA();
}
redirectToA();
That's quite ugly though. Is there a way to simplify this code so that redirectToA(); appears only once?