title: How to manually update a kotlin flow
body: <p>I'm trying to update the source of a Flow in Kotlin and I'm not sure if this is the right approach and if it's possible with Flow at all.</p>
  <p>I have a database containing posts for a user and this returns me a <code>Flow&lt;List&lt;Post&gt;&gt;</code>.
  Now when I select another user I want the flow of the database to return me the posts of the newly selected user:</p>
  <pre><code>
  lateinit var userPosts: Flow&lt;List&lt;Post&gt;&gt;
     private set
  
  fun getPostsForUser(user: User) {
     userPosts = database.getAllPostsForUser(user)
  }
  </code></pre>
  <p>But the flow never gets updated with the data of the new selected user. Is Flow still the right choice in this case and if yes, how can I update the flow with the new posts?</p>
  <p>I know how to do it manually with fetching data from the database and emitting it using LiveData, but I would like to avoid handling the update of posts everytime the user posts something new or a post is deleted.</p>