android / architecture-components-samples

Samples for Android Architecture Components.
https://d.android.com/arch
Apache License 2.0
23.36k stars 8.28k forks source link

[GitHubBrowserSample] Using Kotlin Coroutines Flow APIs in Repository #879

Open PatilShreyas opened 4 years ago

PatilShreyas commented 4 years ago

Currently in GitHubBrowserSample, architecture component - LiveData is used in Repository layer of the application for data flow as reactive stream which can be replaced with Kotlin Coroutines Flow APIs which provides much more features and best for repository layer. Flow is cold reactive stream which can be good at repository layer and we can use LiveData extensions at ViewModel for conversion of Flow into LiveData.

This is suggestion. If it looks good to you then I'll be happy to contribute to this feature.

juanmendez commented 3 years ago

I tried this early this year https://github.com/juanmendez/android-architecture-components. I didn't get a chance to go over all unit tests since they are explicitly using RxJava. I was able to use the same functionality for an app I published.