What is the best way to write following code in RxJs. Assuming getSomethingFromDb( ) returns an observable. Note: I do not want to use IF from my RXJS code
let something:any = getSomethingFromDatabsae( )
if(<value inside something observable is not undefined>){
doThis( );
} else {
doThat( );
}
Edit: I am going to make my question more interesting. What if my code is more complex like this, how to implement this without using if statements in RxJS. ( more declartively )
let observable:any = getSomethingFromDatabsae( )
if(<value inside observable is not undefined>){
doThis( );
} else if(<value inside observable is "one">) {
doFirstThing( );
}else if(<value inside observable is "two">) {
doSecondThing( );
}