@Composable
fun PrimaryScreen() {
val viewModel: PrimaryViewModel = viewModel()
JokesTheme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
val jokes by viewModel.jokes.collectAsState()
JokeList(
jokes = jokes
)
}
}
}
Initially I put it as a parameter, as seen in this question over in #dagger and it appears I can get around that issue with the above code. So, does anyone see anything less than ideal with the code above? Given