How to zip few observables in Kotlin language with RxAndroid

You can also explicitly specify the Function3 type in the lambda Like :

Observable.zip(cats,
               day,
               top,
               Function3<List<Product>, Product, List<Category>, FrontDataModel> 
                         { cats, day, top -> convert(cats, day, top) }

and play with the IntelliJ idea shortcut alt+enter to display more actions and change the displaying format of the high-order function.

enter image description here

Why Function3?

Following The Functional Interfaces if it has two Input params it's a BiFunction and if it has 3 Inputs it's a Function3 and the list goes on.


Just replace function reference with lambda:

return Observable.zip(cats, day, top, { c, d, t -> convert(c, d, t) })

And don't forget to declare function's return type explicitly:

fun getFrontData(): Observable<FrontDataModel> {
    ...