determine whether an Observable emits a particular item or not
A related operator, IsEmpty returns an Observable that emits
true
if and only if the source Observable completes without emitting any items. It emits false
if the source Observable emits an item.
--------------------------------------------------------------------------
List<Integer> list2 = new ArrayList<>();
list2.add(1);
list2.add(2);
list2.add(3);
list2.add(4);
list2.add(5);
Observable.fromIterable(list2).contains(3).subscribe(System.out::println);
--------------------------------------------------------------------------------
No comments:
Post a Comment