isEmpty
Emits false if the input observable emits any values, or emits true if the input observable completes without emitting any values.
Parameters
There are no parameters.
Returns
OperatorFunction<T, boolean>
: An Observable of a boolean value indicating whether observable was empty or not
Description
Tells whether any values are emitted by an observable
isEmpty
transforms an Observable that emits values into an Observable that
emits a single boolean value representing whether or not any values were
emitted by the source Observable. As soon as the source Observable emits a
value, isEmpty
will emit a false
and complete. If the source Observable
completes having not emitted anything, isEmpty
will emit a true
and
complete.
A similar effect could be achieved with count
, but isEmpty
can emit
a false
value sooner.
Examples
Emit false
for a non-empty Observable
Emit true
for an empty Observable