Skip to content

Instantly share code, notes, and snippets.

@steliosfran
Created March 14, 2022 00:13
Show Gist options
  • Save steliosfran/fdd9da44bb38fa33987318690e8a65f7 to your computer and use it in GitHub Desktop.
Save steliosfran/fdd9da44bb38fa33987318690e8a65f7 to your computer and use it in GitHub Desktop.
class ChatViewModel(
private val chatLogic: ChatLogic
) : ViewModel() {
fun observeChatMessages() {
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