Abhimanyu
06/01/2024, 4:16 PMAbhimanyu
06/01/2024, 4:16 PM@Composable
fun HomeScreen() {
var state1 by remember {
mutableStateOf(
value = "First Name",
)
}
var state2 by remember {
mutableStateOf(
value = 123,
)
}
val combinedState = remember(state1, state2) {
// Some logic which creates a new state by processing the existing states.
}
}
In this case, How to test the logic added here?
// Some logic which creates a new state by processing the existing states.
One option I can think of is to extract the code into a top level function outside the HomeScreen
composable and test it.
I would like to know if there are better approaches to structure and test this code. thank you colorZach Klippenstein (he/him) [MOD]
06/01/2024, 5:35 PMAbhimanyu
06/01/2024, 5:35 PMAbhimanyu
06/01/2024, 5:36 PMZach Klippenstein (he/him) [MOD]
06/01/2024, 5:38 PMAbhimanyu
06/01/2024, 5:41 PMZach Klippenstein (he/him) [MOD]
06/01/2024, 5:49 PM