Skip to content

Instantly share code, notes, and snippets.

@ReneeVandervelde
Created June 10, 2017 03:51
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 ReneeVandervelde/8a9caca964c1a4c8a06001b8b855f6f0 to your computer and use it in GitHub Desktop.
Save ReneeVandervelde/8a9caca964c1a4c8a06001b8b855f6f0 to your computer and use it in GitHub Desktop.
import io.reactivex.Observable
import io.reactivex.functions.Consumer
class MyErrorHandler : Consumer<Throwable> {
override fun accept(t: Throwable?) { TODO() }
}
class Foo {
fun main() {
val errorHandler = MyErrorHandler()
Observable.just("foo").subscribe(this::stringConsumer, errorHandler)
}
fun stringConsumer(value: String) { TODO() }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment