79699278

Date: 2025-07-12 12:41:20
Score: 1
Natty:
Report link

I have converted observable to promise and then use await. Don't know this would be right approach or not. There must be better solution.

let result;

if(condition1) {
    result = await firstValueFrom(asyncFun1())
           
} else {
    result = await firstValueFrom(asyncFun2())
}

commongcode
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: OwlR