return Observable.create { emitter ->
foo.fetchBar(object : FooCallback<Bar> {
override fun onSuccess(bar: Bar) {
emitter.onNext(bar)
}
override fun onError(error: Throwable) {
emitter.onError(error)
}
})
}
Last active
June 1, 2018 07:47
-
-
Save NielsMasdorp/ff5fca11e3019900c4fdc701f2dc0898 to your computer and use it in GitHub Desktop.
How to wrap an existing async API in a reactive stream
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment