rootstrap / android-base

Rootstrap Android Base project
https://rootstrap.com
40 stars 6 forks source link

Migrate LiveData to Kotlin Flows #54

Open hrodrick opened 2 years ago

hrodrick commented 2 years ago

As discussed on the Android's Roundtable of 01/12/2021 it seems good to migrate the current LiveData implementations to Kotlin flows, which is the new official way of sharing reactive information between activities and viewmodels.

It brings many benefits like chaining operations, cold and hot flows, defining when we want to react to changes (for example, if we want to react only when the view is resumed or when it is started), independence from Android (we can use it in MPP projects), etc.

As an additional point new libraries built on kotlin are recommended to use with Flows, an example of it is the Android architecture's Paging Library.

Kotlin flows on Android : https://developer.android.com/kotlin/flow