I have one observable A and another observable B (that is a BehaviorSubject). I need that B works like a semaphore, when I get a value changes in A, if B is true, A executes some logic, otherwise A need to wait B become true. I tried different approaches, but without success..
Something like when in C is used sem_wait for waiting 0 value
A
.pipe(
mergeMap(aval => B.filter(f => f))
// Here i need to wait B to become true
)
.subscribe(v => dosomething)
Thanks to all!