I have a javascript function which returns an boolean in some cases or an Observable in some other cases. Can I somehow always return an Observable by creating Observable out of a boolean?
I have a javascript function which returns an boolean in some cases or an Observable in some other cases. Can I somehow always return an Observable by creating Observable out of a boolean?
Addition to the accepted answer, the return of(data) (and not Observable.of(data)) is enough for RxJS 6 and Angular 12.