I have 2 observables. One returns an event and the other boolean. I want to create a new observable that returns the boolean or event while the value in the store is true. Here is the code. This obs1 should wait until the obs2 returns true.
const obs1 = fromEvent(window,'beforeunload')
const obs2 = this.store.select(aBooleanObservable)
const result: Observable<boolean>= ???
senario 1 = Event fired, value in the store true => result true
senario 2 = Event fired, value in the store false => result noting emit until the value is chaneged to true