I am facing an issue where I have three observables and need to pass their values to a service as parameters. I attempted to do this using WithLatestFrom(), but it works fine only when all values are observables.
this.payment$.pipe(
withLatestFrom(this.first$, this.second$, this.three$)
).subscribe((v, first, second, three) => {
this.methodInfoService.fetchInfo(v, first, second, three)
})
The problem arises when the first observable is sometimes undefined, leading to the inability to subscribe to the other two observables. Can anyone suggest an alternative solution to achieve this?