Skip to content

Instantly share code, notes, and snippets.

@smhdk
Created December 4, 2018 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smhdk/47192b40a2e5dd58632f48d3b1c8d5ce to your computer and use it in GitHub Desktop.
Save smhdk/47192b40a2e5dd58632f48d3b1c8d5ce to your computer and use it in GitHub Desktop.
RxJava SkipLast Operator Example with Kotlin
Observable.just(1, 2, 3, 4, 5, 6, 7, 8)
.skipLast(3)
.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