小编ajh*_*jh3的帖子

带有 MVVM 的 RxJava:带有 setValue() 的 MutableLiveData 与 LiveDataReactiveStreams

Let's say you have a MVVM app with a UI layer, a ViewModel, and a Repository. Say that in your repository, you're getting some data from an API with Single Retrofit calls, and transforming it into a UI-ready viewstate object.

The way I see it, you have two main choices (assuming you want to use LiveData in the UI layer, I am not including the option of observing Rx types from the UI):

  1. Expose your Rx Observable from the repository, …

android android-mvvm rx-java2 android-livedata

6
推荐指数
0
解决办法
423
查看次数