Created
December 4, 2018 11:58
-
-
Save smhdk/090d4df3856d65b792e36dffc73c4ece to your computer and use it in GitHub Desktop.
RxJava TakeLast Operator Example with Kotlin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Observable.just(1, 2, 3, 4, 5, 6, 7, 8) | |
.takeLast(4) | |
.subscribe(object : Observer<Int> { | |
override fun onComplete() { | |
println("onComplete") | |
} | |
override fun onSubscribe(d: Disposable) { | |
println("onSubscribe") | |
} | |
override fun onNext(t: Int) { | |
println("onNext: $t") | |
} | |
override fun onError(e: Throwable) { | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment