Compose State Management: When to Use ViewModel vs remember vs rememberSaveable
The article distinguishes three lifecycle events that reset UI state — recomposition, configuration change, and process death — and maps each to the appropriate Compose state holder (remember, retain, rememberSaveable, ViewModel) with a counter example, showing how to persist user-modified data and enable JVM unit testing.
