Not representing the whole team but the top benefits for me are:

  1. It’s a language feature so we can leave a huge 3rd party library out (I love RxJava but such rule of thumb still stands)
  2. In conjunction with Android Architecture Component’s viewModelScope, we don’t need to do disposables.dispose() in onDestroy anymore
  3. Kinda relevant to 1, multi-platform opportunity

We historically made a decision to have our network layer un-opinionated (which I agreed)

interface SomeService {
@GET
fun getSth() : NetworkReponse<SuccessResponse, ErrorResponse>
}

So in our repository layer, we wrap the service calls with Single.fromCallable() which works great except for 1 downside: subscriptions still running when activity/ fragment already destroyed.

Now Kotlin Flow ensures the subscriptions are disposed nicely while we get to keep our network layer un-opinionated :)

Hiring Android engineer shorturl.at/bivJO Clean coder, walker & biker. Hater of inefficiency

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store