...

/

Conditional Operators

Conditional Operators

Let's explore RxJS conditional operators with the help of interactive examples.

What are conditional operators?


Conditional operator helps us in making a decision if a specific condition needs to be met.


defaultIfEmpty() operator

The first one we’re going to look at is the defaultIfEmpty() operator. This operator will emit a value if nothing is returned by a source Observable. If something is returned by the source Observable, then that value is emitted.

Example

A classic ...