Skip to content

Instantly share code, notes, and snippets.

@steliosfran
Created March 14, 2022 00:14
Show Gist options
  • Save steliosfran/516deea1838acfbeed7b54e8a5ce8906 to your computer and use it in GitHub Desktop.
Save steliosfran/516deea1838acfbeed7b54e8a5ce8906 to your computer and use it in GitHub Desktop.
class ChatViewModel(
private val chatLogic: ChatLogic
) : RxViewModel() {
fun observeChatMessages() {
disposables += chatLogic.chatMessages
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
// On next: update the state
}, {
// On error: update the state
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment