
- RxJS Tutorial
- RxJS - Home
- RxJS - Overview
- RxJS - Environment Setup
- RxJS - Latest Updates
- RxJS - Observables
- RxJS - Operators
- RxJS - Working with Subscription
- RxJS - Working with Subjects
- RxJS - Working with Scheduler
- RxJS - Working with RxJS & Angular
- RxJS - Working with RxJS & ReactJS
- RxJS Useful Resources
- RxJS - Quick Guide
- RxJS - Useful Resources
- RxJS - Discussion
RxJS - Conditional Operator isEmpty
This operator will give the output as true if the input observable goes for complete callback without emitting any values and false if the input observable emits any values.
Syntax
isEmpty(): Observable
Return value
It will return an observable with a boolean value as true if the source observable is empty otherwise false.
Example
import { of } from 'rxjs'; import { isEmpty } from 'rxjs/operators'; let list1 = of(); let final_val = list1.pipe(isEmpty(),); final_val.subscribe(x => console.log(x));
Since the source observable is empty, the output given by observable is true.
Output
true
Advertisements