title: LiveData Transformations with Flow
body: <p>Has I read more about Flow I'm starting to think that you can replace MutableLiveData switchMap pattern with something similar with flow.</p>
  <p>You can replace LiveData observation with flow by implementing something like <a href="https://proandroiddev.com/android-singleliveevent-redux-with-kotlin-flow-b755c70bb055" rel="nofollow noreferrer">this</a> but I'm unable to imagine how to replace the switchMap part.</p>
  <p>By switchMap pattern I mean this:</p>
  <pre><code>val mutableLiveData: MutableLiveData&lt;SomeClass&gt; = MutableLiveData()
  val liveData: LiveData&lt;SomeOtherClass&gt; = mutableLiveData
      .switchMap {
         //call to repo
      }
  </code></pre>
  <p>Is there anything equivalent or am I missing out something completely? Or even thinking about flow completely the wrong way.</p>