0

I've got the following code in RxGroovy:

Observable
    .just(1, 2, 3, 4, 5)
    .groupBy({num -> num % 2 == 0})
    ...

And the type of num is Observable<Integer> instead of Integer. I believe the reason is that .groupBy exists in Groovy by default. How can I still use reactive .groupBy method in RxGroovy?

Alex Kokorin
  • 459
  • 5
  • 15

1 Answers1

0

I should have explicitly stated the type, i.e., .groupBy({int num -> num % 2 == 0}) solves the problem.

Alex Kokorin
  • 459
  • 5
  • 15