Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 RxGroovy 中有以下代码:
Observable .just(1, 2, 3, 4, 5) .groupBy({num -> num % 2 == 0}) ...
并且类型num是Observable<Integer>而不是Integer。我相信原因是默认情况下.groupBy存在。如何在 RxGroovy 中仍然使用响应式方法?Groovy .groupBy
num
Observable<Integer>
Integer
.groupBy
Groovy
我应该明确说明类型,即.groupBy({int num -> num % 2 == 0})解决问题。
.groupBy({int num -> num % 2 == 0})