February 2020
Intermediate to advanced
412 pages
9h 36m
English
You could spend a lot of time deconstructing lambda expressions in Kotlin, but in the interest of brevity, we will show only how they are expressed in the context of RxJava. You can learn about Kotlin lambda expressions in depth on the Kotlin site (https://kotlinlang.org/docs/reference/lambdas.html).
Kotlin offers a few more ways to express lambdas than Java 8. For example, it allows curly brackets { } to be used instead of round brackets ( ) to accept lambda arguments into functions. The following is how we express an Observable chain emitting strings, and then map and print their lengths (the ch12_04.kt example):
import io.reactivex.rxjava3.core.Observable fun main(args: Array<String>) { Observable.just("Alpha", ...Read now
Unlock full access