Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class SomePresenterOrViewModelEtc(private val api: GraphQLApi) {
// ...
fun sunscribeToMessages() {
val messagesSubscription = OnNewMessagesReceivedSubscription.builder()
.groupUUID("uuid")
.build()
api.subscribe(messagesSubscription)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
// handle results, like adding the result into a list
}, {
// handle errors
}).addTo(compositeDisposable)
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment