Kotlin Flow tips for ViewModel
Many months have passed since I last wrote about Kotlin Flow: Domain Model’s StateFlow Sharing. So, let’s take a look at something related to Flow handling in a ViewModel. StateIn shortcut Usually, you want a StateFlow‘s state to survive a configuration change. AndroidX’s default time limit is 5 seconds — but only if it’s subscribed. … Read more