I have a problem with this especial situation. How can I call a composable function after I received a result from Observer?
@Composable
fun ProfileScreen(
onNavigate: () -> Unit,
account: Account,
viewModel: DBMovieViewModel = hiltViewModel(),
lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current
) {
viewModel.getListMovies()
Box(
modifier = Modifier
.fillMaxSize()
.background(Color.Black)
) {
Column {
ProfileComponent(account)
viewModel.listMovies.observe(lifecycleOwner){
MediaList(movies = it) -> Here is the problem, I can't call a Composable function in an Observable
}
}
}
}