TBD
TBD
There is also a new operator in RxGroovy 1.1 called switchIfEmpty
that, rather than emitting
a backup value if the source Observable terminates without having emitted any items, it emits the
emissions from a backup Observable.
There is also a new operator in RxJava 1.1 called switchIfEmpty
that, rather than emitting a
backup value if the source Observable terminates without having emitted any items, it emits the
emissions from a backup Observable.
Observable.empty().defaultIfEmpty(10).subscribe( val -> System.out.println("next: " + val), err -> System.err.println(err) , () -> System.out.println("completed") );
next: 10 completed
Flowable.empty().defaultIfEmpty(10).subscribe( val -> System.out.println("next: " + val), err -> System.err.println(err) , () -> System.out.println("completed") );
next: 10 completed