joreilly / PeopleInSpace

Kotlin Multiplatform sample with SwiftUI, Jetpack Compose, Compose for Wear, Compose for Desktop, and Compose for Web clients along with Ktor backend.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] PersonDetailsRoute > uiState line triggers multiple times

Drjacky opened this issue · comments

Any idea why this line triggers a couple of times?

val uiState by viewModel.uiState.collectAsStateWithLifecycle()

By this do you mean that recomposition occurs more often than you think it should?

That state will be initially Loading and then should transition, if not errors, to having the result.

Yes, if you put a breakpoint on that line, it triggers more than once or twice.
But in the log, I couldn't see the API called more than once! [which is good]