Any help will be greatly appreciated
# rx
t
Any help will be greatly appreciated
l
Copy code
…
Function3 { a: Int, b: Int, c: String -> Triple(a, b, c) }
…
t
Just tried this and "Interface Function3 does not have constructors" 😞
a
if you
import io.reactivex.functions.Function3
, it should work
But I recommend https://github.com/ReactiveX/RxKotlin
To help cope with the SAM ambiguity issue when using RxJava 2.x with Kotlin, there are a number of helper factories and extension functions to workaround the affected operators.
1
Then you can do:
Copy code
Observables.zip(
    Observable.just(test1),
    Observable.just(test2),
    Observable.just(test3)
) { a: Int, b: Int, c: String ->
    Triple(a, b, c)
}
Or even:
Copy code
Observables.zip(
    Observable.just(test1),
    Observable.just(test2),
    Observable.just(test3)
)
since that emits a
Triple
as well
t
Brilliant! the import works, and I am now checking out rxkotlin, thank you so much!
a
note that those extra "static" functions from rx-kotlin are in
Observables
, not
Observable